Skip to content

Commit

Permalink
Merge pull request #26 from rubdos/dataframe_in_TdmsObject
Browse files Browse the repository at this point in the history
Added the export to dataframe from within a TdmsObject.
  • Loading branch information
adamreeve committed Jul 8, 2015
2 parents 143a518 + edd3b02 commit 0941a2a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nptdms/tdms.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,19 @@ def _update_data(self, new_data):
else:
self.data.extend(new_data)

def as_dataframe(self):
"""
Converts the TDMS object to a DataFrame
:return: The TDMS object data.
:rtype: Pandas DataFrame
"""

import pandas as pd

return pd.DataFrame(self.data,
index=self.time_track(),
columns=[self.path])


class _TdmsSegmentObject(object):
"""
Expand Down

0 comments on commit 0941a2a

Please sign in to comment.