📜  删除第一列 read_csv - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:22.938000             🧑  作者: Mango

代码示例1
# 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'])