To drop certain irrelevant columns when analyzing a dataset
df.drop(['ColumnX', 'ColumnY', 'ColumnZ'], axis=1, inplace=True)
To count the number of values in a column
df['Column_name'].value_counts()
To change the value to numeric
df['Column_name'] = pd.to_numeric(df['Column_name'])
To replace certain values in a column to other values of choice
df['Column_name'] = df['Column_name'].replace(['Initial_value'], 'New_value')
Top comments (0)