Pandas drop

PHOTO EMBED

Sat Jan 22 2022 22:50:15 GMT+0000 (Coordinated Universal Time)

Saved by @ask4med #python

import pandas as pd

df = pd.DataFrame([('Foreign Cinema', 'Restaurant', 289.0),
                   ('Liho Liho', 'Restaurant', 224.0),
                   ('500 Club', 'bar', 80.5),
                   ('The Square', 'bar', 25.30)],
           columns=('name', 'type', 'AvgBill')
                 )

#Now let's remove the "type" column from our dataset. We set our axis=1 to specify we are dropping #columns
df_drop_column = df.copy()
df_drop_column.drop("type", axis=1)
content_copyCOPY