전체 DataFrame에 대한 연산
In [31]:
pd.options.display.max_rows = 8
movie = pd.read_csv(r'C:\Users\user\jupyterpractice\EDA\Pandas-Cookbook-master\data\movie.csv')
movie.shape
Out[31]:
In [32]:
movie.size
Out[32]:
In [33]:
# numpy에서 ndim은 차원의 수를 반환함
movie.ndim
Out[33]:
In [34]:
# len은 row의 수를 반환함
len(movie)
Out[34]:
In [35]:
# count method로 각 열의 누락값을 제외한 실제 값의 개수를 알아낸다.
movie.count()
Out[35]:
In [36]:
movie.min()
Out[36]:
In [37]:
# 위의 모든 descriptive statistics(기술적인 통계)를 반환하는 describe() method
# 결과는 descriptive statistics를 index로 가지는 DataFrame
movie.describe()
Out[37]:
In [38]:
pd.options.display.max_rows = 10
In [39]:
# percentiles 매개변수를 통해 정확한 분위수를 지정할 수 있음
movie.describe(percentiles=[.01, .3, .99])
Out[39]:
In [40]:
pd.options.display.max_rows = 8
In [42]:
# 결측치(누락값)의 개수 세기 : isnull().sum() method chaining
movie.isnull().sum()
Out[42]:
skipna 매개변수 : 결측치(누락값)을 무시하지 않는 방법¶
- pandas는 default로 수치열의 누락값을 무시하고 통계값을 냄 -> skipna=True가 default인 것.
- skipna = False로 해줌으로써, 하나라도 누락값(결측치)가 있으면 NaN을 반환하도록 할 수 있음.
In [29]:
movie.min(skipna=False)
Out[29]:
'Data Analysis > Exploratory Data Analysis' 카테고리의 다른 글
Pandas (5) Method Chaining (0) | 2021.09.29 |
---|---|
Pandas (3) Column 네이밍 (0) | 2021.09.27 |
Pandas (2) Column 조작 (0) | 2021.09.24 |
Pandas (1) 데이터 정보 확인 (0) | 2021.09.23 |