During the project, I had to deal with a TDMS file. I'm asking because the file could not be read immediately.
My Goal: Perform analysis by converting TDMS file into DataFrame format
First attempt, -Perform TdmsFile open using npTdms package. -Converts to read_data() to execute pd.DataFrame command.
from nptdms import TdmsFile, TdmsWriter, ChannelObject, GroupObject
filenameS = "ex.tdms"
tdms_file = TdmsFile(filenameS)
[enter image description here][1]
So I succeeded in loading using TdmsFile.open() command.
But I tried read_data() on the second attempt and checked the error.
csv_merge = pd.DataFrame()
for i in tdms_file.group_channels('Analog Data'):
temp = i.read_data()
csv_merge = pd.concat([csv_merge, pd.DataFrame({i.channel: temp})], axis=1)
Last attempt,
tdms_file = TdmsFile.open(filenameS)
df = tdms_file.as_dataframe()
Here you go =^..^=
df output: