How to read csv or txt file using pandas

Reading txt  or csv file using python pandas.

import pandas as pd

dataframe =  pd.read_csv("path_to_file", delimiter =',', header=0)

print(dataframe)

File path : file path

delimiter : Separator between each field in data.

header: 0 if file has header, 1 if file doesn't have header.

I have mentioned there commonly used parameters passed while reading file using pandas.

We we read a file using pandas it will give us tabular format data with columns and rows.


Comments