我有一个数据帧,我正在尝试对数据帧中的所有分类值进行编码。下面是我写的一次编码所有分类列的代码, data[col] = data[col].astypeDataframe has no attributed as cat“
AttributeError: 'DataFrame' object has no attri
我想使用read_sql_table()使用SQLAlchemy和Pandas将表从Posgresql数据库读取到Pandas数据帧中。对数据库的SQL查询类似于: SELECT col1,col2 FROM my_table WHERE col1=='value' 我尝试使用以下代码从表中获取Pandas数据帧: from sqlalchemydb_uri, echo=True