Python|Excluding columns|Jupyter Notebook

Question

write a function to exclude columns in csv file.

in progress 0
razack_ar 3 years 2 Answers 598 views Member 3

Answers ( 2 )

  1. import numpy as np
    import pandas as pd
    import matplot.lib as pyplot
    import seaborn as sns

    then import csv file in jupyter notebook
    df = pd.read_csv(‘C:\Users\Ibrahim\Downloads\train_u6lujuX_CVtuZ9i.csv’) ….(for example)

    tdf = df.drop([‘xxx’, ‘yyy’, ‘zzzz’], axis=1)
    tdf.head()

    note:xxx,yyy,zzz=column name

  2. import pandas as pd
    df = pd.read_csv(“nr_bankloans.csv”)
    df.drop([“ed”], axis=1, inplace=True)

Leave an answer

Browse
Browse