Knowledge Base

Importing Datasets into Your Project

How to Import Datasets into Your Project

  1. Open the website with the data you need to download. Here, we’re downloading data on ramen noodle ratings from Kaggle.

  2. Download the file:

  3. Unzip it:

  4. Open Google Sheets and create a new blank doc:

  5. Click File -> Import:

  6. Click Upload -> Select a File From Your Device:

  7. Choose the file you need and click Select. This will open the import settings window, which lets you adjust these options:

    • Actions with the current spreadsheet. Ours is empty, so select Replace spreadsheet.
    • Data separator type. In this example, the cells in the file are separated by commas. If there were semicolons, you’d want to choose Custom and type a semicolon.
    • We don’t need to convert text, so select No.
  8. The data has been imported:

  9. Press (Ctrl + S) to save the file. Name it and click *Save.

  10. Make the file accessible to anyone with the link:

  11. Click Copy Link in the next window to copy the link to the table. Click *Done. The link you copied should look something like this:

    https://docs.google.com/spreadsheets/d/10WseQm5aVrqo52eCS8RmjAQ9kFEFvNjBnrR3W820o5Q/edit?usp=sharing

    This part of the link is the spreadsheet ID: 10WseQm5aVrqo52eCS8RmjAQ9kFEFvNjBnrR3W820o5Q. Copy it and use it in the next step.

  12. Place this code into Jupyter notebook:

    1from io import BytesIO
    2import requests
    3
    4spreadsheet_id = '<GOOGLE_SPREADSHEET_ID>'
    5file_name = 'https://docs.google.com/spreadsheets/d/{}/export?format=csv'.format(spreadsheet_id)
    6r = requests.get(file_name)
    7df = pd.read_csv(BytesIO(r.content))
    8df

    Replace with the spreadsheet ID from the previous step and run the code.

  13. The result:

Send Feedback
close
  • Bug
  • Improvement
  • Feature
Send Feedback
,