【问题标题】:pandas.read_sql() error - str object has no attribute isoformatpandas.read_sql() 错误 - str 对象没有属性 isoformat
【发布时间】:2022-12-19 13:49:59
【问题描述】:

当我运行以下代码时出现错误 - AttributeError: 'str' object has no attribute 'isoformat' 我表中的所有字段都是文本字段。

engine = create_engine(
    f'postgresql+psycopg2://{_db_cred["USER"]}:'
    f'{password}@{host}:'
    f'{port}/{db_name}'
)
with engine.connect() as connection:
    result = pandas.read_sql(
        con=connection,
        sql="select * from table1"
    )

【问题讨论】:

    标签: pandas


    【解决方案1】:

    此链接可能会有所帮助。如果我发现其他任何东西,我会分享。

    Pandas read_sql() - AttributeError: 'Engine' object has no attribute 'cursor'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-10
      • 2016-04-07
      • 2021-07-19
      • 1970-01-01
      • 2018-02-08
      • 2018-03-15
      • 2019-03-30
      • 2016-01-29
      相关资源
      最近更新 更多