Last active
November 9, 2021 17:11
-
-
Save liannewriting/2916c0796f080ff2e643a4029eb4519b to your computer and use it in GitHub Desktop.
data_cleaning_202001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import packages | |
import pandas as pd | |
import numpy as np | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import matplotlib.mlab as mlab | |
import matplotlib | |
plt.style.use('ggplot') | |
from matplotlib.pyplot import figure | |
%matplotlib inline | |
matplotlib.rcParams['figure.figsize'] = (12,8) | |
pd.options.mode.chained_assignment = None | |
# read the data | |
df = pd.read_csv('sberbank.csv') | |
# shape and data types of the data | |
print(df.shape) | |
print(df.dtypes) | |
# select numeric columns | |
df_numeric = df.select_dtypes(include=[np.number]) | |
numeric_cols = df_numeric.columns.values | |
print(numeric_cols) | |
# select non numeric columns | |
df_non_numeric = df.select_dtypes(exclude=[np.number]) | |
non_numeric_cols = df_non_numeric.columns.values | |
print(non_numeric_cols) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment