“Success today requires the agility and drive to constantly rethink, reinvigorate, react, and reinvent” – Bill Gates

Is it possible to read data from Github ? “Yes”

So, for example, to read in the dataset called ‘Iris.csv‘ hosted on the machinelearningmasteryindia repository, what we need to do is to get the link to the raw file and then run the code below. The screenshots show how to obtain the raw link.

Below is the example, How to import data from Github :

#Read data from Github 
import pandas as pd 
url ="https://raw.githubusercontent.com/machinelearningmasteryindia/python/master/Iris.csv" 
df = pd.read_csv(url, error_bad_lines=False)

First step is to login to your GitHub Account and follow below steps :

Step 1 :

List of datasets published on my Github

Step 2:

Step 3:

Note : Copy the url path from step 3 and use in python code as mentioned above to import the data from Github.

Leave a Reply

Your email address will not be published.