Skip to main content

How to load a dataset in Python?

This is the first step for Data scientist work. Data is very important in this field without data there is nothing to do here. I mean data is everything, not only number it consists of image, audio,  video or anything.

In this post, I will tell the process to load simple dataset in CSV format. I recommend installing jupyter or spyder from Anaconda website.

Packages you want to install in cmd or terminal 

pip install pandas
pip install numpy
pip install matplotlib

Mostly these packages will be installed default. Just for a verification check whether  it is installed.

Numpy
            It is a mathematical tool used to do some complex calculation.

Pandas
             Without pandas, we can import the data. It is manually used to form a data frame and other allocation processes.

Matplotlib
                It is one of the visualization packages in python. It is used to visualize data.  

I write the standard code below to import CSV file


import pandas as pd
import numpy as np

data =pd.read_csv("path to the file")
data.head()

There are a lot of commands like read_csv,read_html, read_json etc.

Head() is to describe top 5 rows in the table.

I feel this is the first step to the data science

Happy Learning!!!







Comments