[Python] Import csv from Kaggle url into a pandas DataFrame

Discussão em 'Python' iniciado por Stack, Fevereiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    I want to import a public dataset from Kaggle (https://www.kaggle.com/unsdsn/world-happiness?select=2017.csv) into a local jupyter notebook. I don't want to use any credencials in the process.

    I saw diverse solutions including: pd.read_html, pd.read_csv, pd.read_table (pd = pandas). I also found the solutions that imply a login.

    The first set of solutions are the ones I am interested in, though I see that they work on other websites because there is a link to the raw data. I have been clincking everywhere in the kaggle interface but find no direct url to raw data.

    Bottom line: Is it possible to use say pd.read_csv to directly get data from the website into your local notebook? If so, how?

    Continue reading...

Compartilhe esta Página