Python ';表';不承认';ISHDF5文件';
我正在编写一个代码,创建一个HDF5,以后可以用于数据分析。我加载以下包:Python ';表';不承认';ISHDF5文件';,python,numpy,hdf5,Python,Numpy,Hdf5,我正在编写一个代码,创建一个HDF5,以后可以用于数据分析。我加载以下包: import numpy as np import tables 然后,我使用表格模块确定我的文件是否为HDF5文件,其中包含: tables.isHDF5File(FILENAME) 这通常会根据文件类型是否为HDF5文件打印TRUE或FALSE。但是,我得到了一个错误: AttributeError:模块“tables”没有属性“isHDF5File” 所以我试着: from tables import isHD
import numpy as np
import tables
然后,我使用表格模块确定我的文件是否为HDF5文件,其中包含:
tables.isHDF5File(FILENAME)
这通常会根据文件类型是否为HDF5文件打印TRUE或FALSE。但是,我得到了一个错误:
AttributeError:模块“tables”没有属性“isHDF5File”
所以我试着:
from tables import isHDF5File
并得到了错误信息:
ImportError:无法导入名称“isHDF5File”
我在另一台计算机上试过这个代码,它运行得很好。我尝试过用pip更新numpy和表,但它表明该文件已经是最新的。“表”没有为我识别“isHDF5File”有什么原因吗?我在Mac电脑上运行此代码(不工作),但在PC上运行(如果这很重要)。您的函数名正确吗
In [21]: import tables
In [22]: tables.is_hdf5_file?
Docstring:
is_hdf5_file(filename)
Determine whether a file is in the HDF5 format.
When successful, it returns a true value if the file is an HDF5
file, false otherwise. If there were problems identifying the file,
an HDF5ExtError is raised.
Type: builtin_function_or_method
In [23]:
你有正确的函数名吗
In [21]: import tables
In [22]: tables.is_hdf5_file?
Docstring:
is_hdf5_file(filename)
Determine whether a file is in the HDF5 format.
When successful, it returns a true value if the file is an HDF5
file, false otherwise. If there were problems identifying the file,
an HDF5ExtError is raised.
Type: builtin_function_or_method
In [23]:
您是否调用了一个脚本
tables.py
?如果是,请重命名它。您是否调用了一个脚本tables.py
?如果是,请重命名它。