Gaurav Raina
Gaurav Raina

Reputation: 65

Getting Null Values while reading Values into a dataframe in python

I am trying to read a .csv file into a Python dataframe but it is showing null values.

The .csv file has columns separated by ;.

I am using this code:

import pandas as pd    
data = pd.read_csv('testfile.csv', sep = ';')

and this is the output:

enter image description here

All values are null and number of rows got doubled

Upvotes: 0

Views: 1166

Answers (1)

Gaurav Raina
Gaurav Raina

Reputation: 65

data = pd.read_csv('testfile.csv', sep = ';' , encoding = 'UTF-16')

Upvotes: 1

Related Questions