import pandas as pd
df = pd.read_csv('sample.csv')
df.median()
or
df.corr()
[ Error message ]
---------------------------------------------------------------------------------------------------------------------------------
<ipython-input-27-e41201014d8f>:1: FutureWarning: The default value of numeric_only in DataFrame.median is deprecated. In a future version, it will default to False. In addition, specifying 'numeric_only=None' is deprecated. Select only valid columns or specify the value of numeric_only to silence this warning.
---------------------------------------------------------------------------------------------------------------------------------
or
---------------------------------------------------------------------------------------------------------------------------------
<ipython-input-24-49b3fcfeb4d1>:1: FutureWarning: The default value of numeric_only in DataFrame.corr is deprecated. In a future version, it will default to False. Select only valid columns or specify the value of numeric_only to silence this warning.
---------------------------------------------------------------------------------------------------------------------------------
or
---------------------------------------------------------------------------------------------------------------------------------
<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.
---------------------------------------------------------------------------------------------------------------------------------
[ Solve ]
Select only valid columns or set numeric_only=True.
df[["english", "math"]].median()
or
df.median(numeric_only=True)
df[["english", "math"]].corr()
df.corr(numberic_only=True)
'개발 > Python' 카테고리의 다른 글
Ubuntu 24.04 python3 numpy library install (0) | 2024.07.20 |
---|---|
Pandas DataFrame mean(), median(), std(), var(), corr() FutureWarning (0) | 2024.03.26 |
Pandas reset_index() error (0) | 2024.02.20 |
구글 코랩 판다스 read_csv 인코딩 오류 (0) | 2024.02.17 |
로또 번호 생성기, 로또 6/45 (0) | 2023.12.15 |