728x90
반응형
>>> import pandas as pd
>>> df1 = pd.read_csv('sample.csv')
>>> df1.mean()
<stdin>:1: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.
Eng 83.1
Math 73.7
dtype: float64
[ Solve ]
Select only valid columns or set numeric_only=True.
>>> df1.mean(numeric_only=True)
>>> df1.median(numeric_only=True)
>>> df1.std(numeric_only=True)
>>> df1.var(numeric_only=True)
>>> df1.corr(numeric_only=True)
or
>>> df1[['Eng', 'Math']].mean()
>>> df1[['Eng', 'Math']].median()
>>> df1[['Eng', 'Math']].std()
>>> df1[['Eng', 'Math']].var()
>>> df1[['Eng', 'Math']].corr()
728x90
반응형
'개발 > Python' 카테고리의 다른 글
Ubuntu 24.04 python3 pandas library install (0) | 2024.07.20 |
---|---|
Ubuntu 24.04 python3 numpy library install (0) | 2024.07.20 |
Pandas DataFrame FutureWarning (0) | 2024.03.13 |
Pandas reset_index() error (0) | 2024.02.20 |
구글 코랩 판다스 read_csv 인코딩 오류 (0) | 2024.02.17 |