📌  相关文章
📜  将每一列转换为布尔类型 - 无论代码示例

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

代码示例1
df1['Have you seen any of the 6 films in the Star Wars franchise?']=df1['Have you seen any of the 6 films in the Star Wars franchise?'].map({'Yes':True,'No':False})
df1['Do you consider yourself to be a fan of the Star Wars film franchise?'] = df1['Do you consider yourself to be a fan of the Star Wars film franchise?'].map({'Yes':True,'No':False})

df1.head()