'EmptyDataError: No columns to parse from file

Currently I am getting the below Error and I am tried out the below posts:

  1. Solution 1
  2. Solution 2

But I am not able to get the error resolved. My python code is as below:

import pandas as pd
testdata = pd.read_csv(file_name, header=None, delim_whitespace=True)

I tried to print the value in testdata but it doesn't show any output.

The following is my csvfile:

Screenshot



Solution 1:[1]

Firstly, declare your filename inside testdata as a string, and make sure it is either in the local directory, or that you have the correct filepath.

import pandas as pd
testdata = pd.read_csv("filename.csv", header=None, delim_whitespace=True)

If that does not work, post some information about the environment you are using.

Solution 2:[2]

First, you probably don't need header=None as you seem to have headers in the file. Also try removing the blank line between the headers and the first line of data. Check and double check your file name.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ajsp
Solution 2 blissweb