pandas read_csv index first column code example
Example 1: pandas read_csv ignore first column
pd.read_csv('path/to/file.csv',index_col=0)
Example 2: drop first column read_csv
# Read column names from file
cols = list(pd.read_csv("sample_data.csv", nrows =1))
print(cols)
# Use list comprehension to remove the unwanted column in **usecol**
df= pd.read_csv("sample_data.csv", usecols =[i for i in cols if i != 'name'])