Last active
November 25, 2020 17:11
-
-
Save rrosasl/9a79cf881ff5322bbbaebf6af6e0d9ad to your computer and use it in GitHub Desktop.
Importing google sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth.authenticate_user() | |
# https://colab.research.google.com/notebooks/snippets/sheets.ipynb | |
import gspread | |
from oauth2client.client import GoogleCredentials | |
gc = gspread.authorize(GoogleCredentials.get_application_default()) | |
#worksheet = gc.open('Your spreadsheet name').sheet1 | |
wb = gc.open_by_url('https://docs.google.com/spreadsheets/d/1cH8SE6ba4LqYA0kIS8n9LFt2zJQvh7EZaldcJ_MzgyA/edit#gid=48937339') | |
# get_all_values gives a list of rows. | |
wb = wb.worksheet('Form Responses 1') | |
rows = wb.get_all_values() | |
# Convert to a DataFrame and render. | |
df = pd.DataFrame.from_records(rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment