Art*_*nov 2 python hdf5 pandas
我的脚本正在做以下事情:
trc文件读取时间序列(UHF 测量)pd.DataFrameDataFrames到一个hdf5文件中这工作正常,但tables模块似乎NaturalNameWarning为每个单个DataFrame.
这是DataFrames保存到的位置hdf5:
num = 0
for idx, row in df_oszi.iloc[peaks].iterrows():
start_peak = idx - 1*1e-3
end_peak = idx + 10*1e-3 #tges=11us
df_pos = df_oszi[start_peak:end_peak]
df_pos.to_hdf('pos.h5', key=str(num))
num += 1
Run Code Online (Sandbox Code Playgroud)
输出:
Warning (from warnings module):
File "C:\Users\Artur\AppData\Local\Programs\Python\Python37\lib\site-packages\tables\path.py", line 157
check_attribute_name(name)
NaturalNameWarning: object name is not a valid Python identifier: '185'; it does not match the pattern ``^[a-zA-Z_][a-zA-Z0-9_]*$``; you will not be able to use natural naming to access this object; using ``getattr()`` will still work, though
Run Code Online (Sandbox Code Playgroud)
小智 6
只要您不真正打算使用表访问,您就可以随时执行此操作。
import warnings
from tables import NaturalNameWarning
warnings.filterwarnings('ignore', category=NaturalNameWarning)
Run Code Online (Sandbox Code Playgroud)