【发布时间】:2019-10-29 16:22:31
【问题描述】:
我有一个新创建的 Pandas 数据框,由于某种原因我无法从中删除列。
RangeIndex:2617 个条目,0 到 2616 列:111 个条目,访问分区 数据类型:对象(111) 内存使用:2.2+ MB 无
print list(df)
['access', 'age', 'attic', 'basement_type', 'bathrooms', 'bedrooms_total', 'buyer', 'buyer_city', 'buyer_country', 'buyer_postal_code', 'colisting_agent_id', 'construction ','csa_number','date_expired_hidden','date_listed','date_sold','date_unconditional','distance_to_schools','distance_to_transportation','district','ensuites','exterior_features','exterior_finish','fireplace_types', '壁炉'、'地板'、'燃料'、'供暖'、'id'、'interior_features'、'internet_remarks']
df = df.drop(['buyer', 'buyer_city', 'buyer_country', 'colisting_agent_id'], axis=1, inplace=True)
print list(df)```
TypeErrorTraceback (most recent call last)
<ipython-input-63-1db0e7488634> in <module>()
6
7
----> 8 print list(df)
TypeError: 'NoneType' object is not iterable
【问题讨论】: