简体   繁体   English

EmptyDataError:没有要从文件中解析的列

[英]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 解决方案1
  2. Solution 2 解决方案2

But I am not able to get the error resolved.但我无法解决错误。 My python code is as below:我的python代码如下:

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.我试图打印 testdata 中的值,但它没有显示任何输出。

The following is my csvfile:以下是我的 csvfile:

截图

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.首先,将testdata中的文件名声明为字符串,并确保它位于本地目录中,或者您具有正确的文件路径。

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.如果这不起作用,请发布有关您正在使用的环境的一些信息。

First, you probably don't need header=None as you seem to have headers in the file.首先,您可能不需要 header=None ,因为您似乎在文件中有标题。 Also try removing the blank line between the headers and the first line of data.还可以尝试删除标题和第一行数据之间的空行。 Check and double check your file name.检查并仔细检查您的文件名。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有要从文件中解析的列 (EmptyDataError: ) - No columns to parse from file (EmptyDataError: ) EmptyDataError:没有要从文件中解析的列 - EmptyDataError : No columns to parse from file EmptyDataError 没有要从文件中解析的列 - EmptyDataError No columns to parse from file EmptyDataError:没有要从关于 streamlit 的文件中解析的列 - EmptyDataError: No columns to parse from file about streamlit 无法读取.csv 文件。 EmptyDataError:没有要从文件中解析的列 - Cant read .csv file. EmptyDataError: No columns to parse from file EmptyDataError:在字典中加载多个文件时没有要从文件中解析的列 - EmptyDataError: No columns to parse from file when loading several files in a dictionary pandas.errors.EmptyDataError:没有要从文件中解析的列 - pandas.errors.EmptyDataError: No columns to parse from file Pandas - EmptyDataError:读取库存 .csv 文件时没有要从文件中解析的列 - Pandas - EmptyDataError: No columns to parse from file when reading stock .csv file 将目录中的所有文件连接到单个 CSV 时,Pandas 中的“EmptyDataError:没有要从文件中解析的列” - 'EmptyDataError: No columns to parse from file' in Pandas when concatenating all files in a directory into single CSV EmptyDataError:从 S3 存储桶读取多个 csv 文件到 Pandas Dataframe 时,没有要从文件解析的列 - EmptyDataError: No columns to parse from file when reading multiple csv files from S3 bucket to pandas Dataframe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM