title: TDMS file read data in python
body: <p>During the project, I had to deal with a TDMS file.
  I'm asking because the file could not be read immediately.</p>
  <p>My Goal: Perform analysis by converting TDMS file into DataFrame format</p>
  <p><strong>First attempt</strong>,
  -Perform TdmsFile open using npTdms package.
  -Converts to read_data() to execute pd.DataFrame command.</p>
  <pre><code>from nptdms import TdmsFile, TdmsWriter, ChannelObject, GroupObject
  filenameS = &quot;ex.tdms&quot;
  tdms_file = TdmsFile(filenameS)
  
  [enter image description here][1]
  </code></pre>
  <p>So I succeeded in loading using TdmsFile.open() command.</p>
  <p>But I tried read_data() on the <strong>second attempt</strong> and checked the error.</p>
  <pre><code>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)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Lj0Oc.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p><strong>Last attempt</strong>,</p>
  <pre><code>tdms_file = TdmsFile.open(filenameS)
  df = tdms_file.as_dataframe()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/g5mxI.png" rel="nofollow noreferrer">enter image description here</a></p>