Skip to content

Instantly share code, notes, and snippets.

@vrootic
Created October 3, 2014 14:01
Show Gist options
  • Select an option

  • Save vrootic/ff34998921d68322db8d to your computer and use it in GitHub Desktop.

Select an option

Save vrootic/ff34998921d68322db8d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import numpy as np
import pandas as pd
import data_generator as dg
def reduce_data():
result = []
for day in dg.group_data():
location_result = []
for location in day:
channel_result = []
for channel in location:
channel_result.append(channel.rssi)
location_result.append(channel_result)
result.append(location_result)
return result
def group_data_by_day(reduce_data):
all_group_data = []
for j in xrange(58):
group_data = []
for i in xrange(30):
group_data.append(reduce_data[i][j])
s = pd.DataFrame(group_data, columns=dg.all_fq, index=pd.date_range('8/9/2014', periods=30))
all_group_data.append(s)
return all_group_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment