Step 1: Hit “Raw” button
You go to the Github page and find the csv file page. For instance, you can click this link for one. Then, you click Raw.
Step 2: Copy the raw link and paste into the read_csv()
Next, you copy the link and paste it within the function of
read_csv() from Pandas.
import pandas as pd df=pd.read_csv("https://raw.githubusercontent.com/TidyPython/Pandas_read_save_files/main/car_data.csv") print(df)
Unnamed: 0 Brand Location Year DateTime 0 0 Tesla CA 2019 2019-03-10 1 1 Tesla CA 2018 2018-03-11 2 2 Tesla NY 2020 2020-01-01 3 3 Ford MA 2019 2019-03-24
Finally, as you see, the print out shows that we successfully read the CSV file from Github.