【问题标题】:'GSpreadException: the given 'expected_headers' are not uniques' error\'GSpreadException: the given \'expected_headers\' are not uniques\' 错误
【发布时间】:2023-01-27 06:42:34
【问题描述】:

尝试使用 gspread 库中的 get_all_records 函数时出现以下错误。这在过去的几个月里工作得很好,但现在就停止了。添加了工作表的图片作为参考。 我正在使用以下代码:

mer = input_spreadsheet.worksheet('sheet_1')
sheet_mer = pd.DataFrame(mer.get_all_records())
GSpreadException                          
      1 mer = input_spreadsheet.worksheet('sheet_1')
----> 2 sheet_mer = pd.DataFrame(mer.get_all_records())

  436         # make sure they are uniques
    437         if len(expected) != len(expected_headers):
--> 438             raise GSpreadException("the given 'expected_headers' are not uniques")
    439 
    440         if not expected & headers == expected:

GSpreadException: the given 'expected_headers' are not uniques

【问题讨论】:

    标签: python sql


    【解决方案1】:

    开发人员建议的替代方案看起来像是一个已知问题: https://github.com/burnash/gspread/issues/1007

    【讨论】:

      【解决方案2】:

      我收到此错误是因为右列中有一些数据(没有标题)。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-09-22
        • 1970-01-01
        • 2016-02-16
        • 2022-12-26
        • 1970-01-01
        • 2017-08-27
        • 2011-07-29
        • 2023-01-17
        相关资源
        最近更新 更多