title: Append Data from a Data Frame to Google Sheet - Understanding the error -
body: <p>The goal of this question is understand Why I get this error message if I do X and Why
  I don't get if I do Y.</p>
  <p>Probably is a silly question.</p>
  <p>I want to update an Google Sheet from my End User Account on Google Colab.
  The update consist in adding the column header of a data frame to a new worksheet.</p>
  <p>I read the <code>gspread</code> <a href="https://docs.gspread.org/en/latest/user-guide.html#using-gspread-with-pandas" rel="nofollow noreferrer">documentation</a> and I saw how the do:</p>
  <pre><code>import pandas as pd
  
  worksheet.update([dataframe.columns.values.tolist()] + dataframe.values.tolist())
  </code></pre>
  <p>Why if I remove the square brackets I get and error like:</p>
  <blockquote>
  <p>APIError: {'code': 400, 'message': 'Invalid value at 'data.values[0]' (type.googleapis.com/google.protobuf.ListValue)</p>
  </blockquote>
  <p>I created a reproducible code to try understand better:</p>
  <pre><code># Creating my dummy Data Frame
  test_dict = {&quot;Date&quot;:[],&quot;KPI1&quot;:[],&quot;KPI2&quot;:[]}
  test_df = pd.DataFrame(test_dict)
  
  # Creating my test sheet on Google Sheet 
  sheet_name_test= &quot;Test&quot;
  sh_test = gc.create(sheet_name_test)
  
  #Adding a specific worksheet
  worksheet_test = sh_test.add_worksheet(title = &quot;test&quot;, 
                                 rows =10, 
                                 cols =5)
  #In that way works 
  worksheet_test.update([test_df.columns.values.tolist()])
  #In that way desn't work
  worksheet_test.update(df_columns_order.columns.values.tolist())
  </code></pre>
  <p>In that way I get the previous highlighted error:</p>
  <pre><code>APIError: {'code': 400, 'message': 'Invalid value at \'data.values[0]\' (type.googleapis.com/google.protobuf.ListValue), &quot;Date&quot;\nInvalid value at \'data.values[1]\' (type.googleapis.com/google.protobuf.ListValue), &quot;KPI1&quot;\nInvalid value at \'data.values[2]\' (type.googleapis.com/google.protobuf.ListValue), &quot;KPI2&quot;', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'data.values[0]', 'description': 'Invalid value at \'data.values[0]\' (type.googleapis.com/google.protobuf.ListValue), &quot;Date&quot;'}, {'field': 'data.values[1]', 'description': 'Invalid value at \'data.values[1]\' (type.googleapis.com/google.protobuf.ListValue), &quot;KPI1&quot;'}, {'field': 'data.values[2]', 'description': 'Invalid value at \'data.values[2]\' (type.googleapis.com/google.protobuf.ListValue), &quot;KPI2&quot;'}]}]}
  </code></pre>