보조기억장치

FutureWarning: Calling int on a single element Series is deprecated and will raise a TypeError in the future. Use int(ser.iloc[0]) instead 본문

Any

FutureWarning: Calling int on a single element Series is deprecated and will raise a TypeError in the future. Use int(ser.iloc[0]) instead

캐세이 2024. 1. 19. 23:43

https://www.w3schools.com/python/pandas/ref_df_iloc.asp#:%7E:text=The%20iloc%20property%20gets%2C%20or%20sets%2C%20the%20value,another%20list%3A%20df.iloc%20%5B%20%5B0%2C%202%5D%2C%20%5B0%2C%201%5D%5D

 

Pandas DataFrame iloc Property

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

 

정의 및 사용법

 

속성 iloc은 지정된 인덱스의 값을 가져오거나 설정합니다.
행과 열을 모두 인덱스로 지정합니다.
두 개 이상의 행에 액세스하려면 이중 대괄호를 사용하고 쉼표로 구분하여 인덱스를 지정합니다.
df.iloc[[0, 2]]

 

다른 목록에 해당 인덱스를 포함하여 열을 지정합니다.
df.iloc[[0, 2], [0, 1]]

콜론으로 구분된 from 및 to 인덱스를 사용하여 DataFrame의 조각을 지정할 수도 있습니다 .
df.iloc[0:2]