costerwi / dwdatareader

Python module to interact with Dewesoft DWDataReaderLib shared library
MIT License
14 stars 9 forks source link

How to get the data? #20

Closed Tough-Stone closed 4 years ago

Tough-Stone commented 5 years ago

I have been able to get the field names in the dxd file, how can I get the data in each field name?

costerwi commented 5 years ago

I assume you are referring to the channel names and channel data. Probably you are looking for the DWChannel.series() method. It returns a Pandas Series containing the data from the channel. For example:

import dwdatareader as dw
with dw.open('myfile.d7d') as f:
    print(f.info)
    data = f['chname1'].series()
    print(data.mean())