假设我们有一个包含许多列Name,Sex, Age, Education, Race
的数据框。我只想创建带有以下列Age,Sex,Educaion
的DF。
我知道我可以使用以下方法做到这一点。
df2 = pd.DataFrame(df[['Age','Sex','Education']]
有没有办法做这样的事情。即选择除x,y,z以外的所有列。
df2 = pd.DataFrame(df(select all columns except the following columns = 'Race', 'Name'))