python pandas AttributeError: ‘DataFrame‘ object has no attribute ‘ix‘_attributeerror: 'dataframe' object has no attribut-CSDN博客

网站介绍:文章浏览阅读5.8k次,点赞4次,收藏4次。python使用pandas DataFrame.ix的时候 AttributeError: 'DataFrame' object has no attribute 'ix'在使用进行DataFrame.ix进行表中的数据块选择的时候,会抛出’DataFrame’ object has no attribute ‘ix’,这个是由于在不同的pandas的版本中,DataFrame的相关属性已过期,已不推荐使用导致的。df.ix[:,'table_header'] # 已过期可以使用loc进行替换即_attributeerror: 'dataframe' object has no attribute 'index