Reading a csv file using pandas.read_csv():

Code 1: read_csv is an important function in python for data science for reading csv files and performing operations on it.

Reading a csv file using pandas.read_csv()  in Python for Data Science

It is simple to open a csv file in the above manner. But apart from opening files, it can perform other operations for changing the return object completely. For example, we can read a csv file locally as well as from a URL through read_csv. We can also select which columns are there to export so; we don’t have to edit the array later.

Below is a list of parameters it will take on their default values.

Reading a csv file using pandas.read_csv()  in Python for Data Science

Not all of these are equally important, but if we remember these, it will save the time of performing the same functions on own. We can see parameters of any function by pressing Shift + Tab in the Jupyter Notebook. Some useful ones are given below.

Code 2:

So, to learn more about csv files in python for data science, you can check this and this as well.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.