728x90
DataFrame.iloc
정의
- 정수 값을 이용해 데이터프레임의 특정 위치를 인덱스 기반으로 선택한다.
.iloc[]는 주로 0부터 축의 길이 -1 사이의 정수값으로 사용 가능 가능하지만, boolean array를 사용할 수도 있다.
아래와 같이 이용 가능하다
- An integer, e.g.
5
. - A list or array of integers, e.g.
[4, 3, 0]
. - A slice object with ints, e.g.
1:7
. - A boolean array.
- A
callable
function with one argument (the calling Series, DataFrame or Panel) and that returns valid output for indexing (one of the above)
예제 코드
Reference
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.iloc.html
728x90
'파이썬(Python) > Pandas' 카테고리의 다른 글
pandas에서 describe() 사용하면 전체 숫자가 안나올 때 (0) | 2021.03.17 |
---|---|
python에서 pandas dataframe에서 컬럼의 text가 모두 안보이는 경우 (0) | 2021.03.12 |
Python의 DataFrame에서 모든 column이 나오게 하는 방법 (0) | 2021.03.12 |
dataframe 생성하기 (0) | 2021.02.03 |
pandas dataframe에 row 추가하기 (0) | 2021.02.03 |