热线电话:13121318867

登录
2019-07-02 阅读量: 550
如何删除指定列名的列

示例#:删除列名称的列

在他的代码中,使用列名删除Passed列。axis 参数保持为1,因为1表示列。

# importing pandas module

import pandas as pd

# making data frame from csv file

data = pd.read_csv("nba.csv", index_col ="Name" )

# dropping passed columns

data.drop(["Team", "Weight"], axis = 1, inplace = True)

# display

data

0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子