-1
I started using google colab to do some analysis of the company and it gives the option to instead of reading the csv file, already automatically read the existing file in the google sheets in the drive. The problem is that it is putting the columns name as the first row of df. Does anyone know how to fix this? The code generated by the colab for this reading is below
!pip install --upgrade gspread
from google.colab import auth
auth.authenticate_user()
import gspread
from oauth2client.client import GoogleCredentials
gc = gspread.authorize(GoogleCredentials.get_application_default())
worksheet = gc.open('nome planilha').sheet1
# get_all_values gives a list of rows.
rows = worksheet.get_all_values()
print(rows)
# Convert to a DataFrame and render.
import pandas as pd
pd.DataFrame.from_records(rows)
Ronaldo, good morning! How is the spreadsheet organized in google Docs? Could you put a print?
– lmonferrari
I put the result that is appearing in the colab, but if you need the google sheet print I can also take. Thank you very much!
– Ronaldo Silveira Junior