How to read Pandas csv file with no header?

0 votes
I have a csv file that I am importing in my Python script using pandas. The csv file start with cell values and doesn’t contain headings. Pandas is considering the first row value as heading. How to read csv without heading?
Apr 3, 2019 in Python by Raj
5,022 views

1 answer to this question.

0 votes

You can set the header option to None to ignore header.

file = pd.read_csv('Diabetes.csv', header=1)
answered Apr 3, 2019 by Shri
file = pd.read_csv('Diabetes.csv', header=None) 
We need to keep header as None instead of 1

Related Questions In Python

0 votes
1 answer

How to create blank csv file in pandas?

Try this code: open("User data.csv", 'w') Where User data.csv ...READ MORE

answered Apr 5, 2019 in Python by Will
1,254 views
0 votes
2 answers

How to check if a csv file is empty in pandas?

Try this: df = pd.DataFrame(columns=['Name', 'ID', 'Department']) if df.empty ...READ MORE

answered Jul 1, 2019 in Python by Bob
1,466 views
0 votes
1 answer
+1 vote
4 answers

How to write nested dictionaries to a CSV file

Using DictWriter there is no need in ...READ MORE

answered Oct 18, 2018 in Python by Richard William
8,352 views
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 653 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

How to print just one column in pandas?

You can use the header to print ...READ MORE

answered Apr 3, 2019 in Python by TIna
173 views
+1 vote
2 answers

How to install tkinter in pycharm?

Ya, this is a problem with installing ...READ MORE

answered Apr 3, 2019 in Python by Jishan
12,618 views