Skip to content

Practical Bits of Code

ArcticSnow edited this page Nov 8, 2018 · 1 revision

Practical Bits of Code

Read waspmote data files directly from SD

The waspUiO library saves data in frame format, itself written in binary format. Here is a short python 3 code to read a file into a Pandas Dataframe.

Required libraries:

import pandas as pd
import waspmote as wp

fname = 'enter path of data file'

data = pd.DataFrame()
with open(fname, 'rb') as f:
    for frame in wp.read_wasp_data(f):
        data = data.append(frame, ignore_index=True)