drop first column read csv

Solutions on MaxInterview for drop first column read csv by the best coders in the world

showing results for - "drop first column read csv"
Sara
27 Jun 2016
1# Read column names from file
2cols = list(pd.read_csv("sample_data.csv", nrows =1))
3print(cols)
4
5# Use list comprehension to remove the unwanted column in **usecol**
6df= pd.read_csv("sample_data.csv", usecols =[i for i in cols if i != 'name'])