Ask a Question

Data Science# Pandas Dataframe - Trying to filter int and float columns
# storing indices of all numerical data types in numerical_cols
numerical_cols = df.select_dtypes(include=['int', 'float']).columns
# storing indices of all numerical data types in numerical_cols
numerical_cols = data.select_dtypes(include=['int64', 'float64']).columns
in my jupyter notebook, for a csv data file sometimes the first code works
and sometimes the second code works.
can anyone letme know? Thanks

Pandas Dataframe - Trying to filter int and float columns
# storing indices of all numerical data types in numerical_cols
numerical_cols = df.select_dtypes(include=['int', 'float']).columns
# storing indices of all numerical data types in numerical_cols
numerical_cols = data.select_dtypes(include=['int64', 'float64']).columns
in my jupyter notebook, for a csv data file sometimes the first code works
and sometimes the second code works.
can anyone letme know? Thanks

Fuel your ambition, discover your passion and achieve your professional goals with LetsUpgrade.

Sign Up Now