Код: Выделить всё
df_1 = df.groupby(['LOCATION','TYPE',pd.cut(df['GRT'], [0, 3500, 8000, 14000, 18000, 26000, 40000, 75000, 300000])])['REVENUE'].sum().reset_index(name="sum")
Код: Выделить всё
gc = gspread.authorize(creds)
spreadsheet = gc.open_by_key('1a1aaaaaaaaaaaaaaaaa')
target = spreadsheet.get_worksheet_by_id(1174387715)
target.update(None,df_1)
Код: Выделить всё
ValueError Traceback (most recent call last)
in ()
2
3 target = spreadsheet.get_worksheet_by_id(1174387715)
----> 4 target.update(None,df_1)
2 frames
/usr/local/lib/python3.10/dist-packages/pandas/core/generic.py in __nonzero__(self)
1517 @final
1518 def __nonzero__(self) -> NoReturn:
-> 1519 raise ValueError(
1520 f"The truth value of a {type(self).__name__} is ambiguous. "
1521 "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Подробнее здесь: https://stackoverflow.com/questions/790 ... adsheet-in