-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcommon.py
More file actions
22 lines (18 loc) · 1017 Bytes
/
Copy pathcommon.py
File metadata and controls
22 lines (18 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pandas as pd
def get_initial_state_variables(df):
i=0
row_list = []
for index, rows in df.iterrows():
# Create list for the current row
temp_list =[rows.channel0, rows.channel1, rows.channel2, rows.channel3, rows.channel4, rows.channel5, rows.channel6, rows.channel7, rows.channel8, rows.channel9, rows.channel10, rows.channel11, rows.channel12, rows.channel13, rows.channel14, rows.channel15]
# append the list to the final list
row_list += temp_list
i += 1
if (i == 16):
break
if (len(row_list) != 256):
print ("Error: state variable list should have 256 members")
return row_list
def get_obs_from_df_row(row):
temp_list =[row.channel0, row.channel1, row.channel2, row.channel3, row.channel4, row.channel5, row.channel6, row.channel7, row.channel8, row.channel9, row.channel10, row.channel11, row.channel12, row.channel13, row.channel14, row.channel15]
return temp_list