I have the following dataframe:
name day value time
0 MAC000002 2012-12-16 0.147 09:30:00
1 MAC000002 2012-12-16 0.110 10:00:00
2 MAC000002 2012-12-16 0.736 10:30:00
3 MAC000003 2012-12-16 0.404 09:30:00
4 MAC000003 2012-12-16 0.845 10:00:00
I want to convert the values only to a numpy array:
[[0.147, 0.110, 0.736],[0.404, 0.845 ...],...]
The only way I can think to do this is to pivot the dataframe then dump the values:
new_df = pd.pivot_table(df,index=["name"],values=["value"])
data = new_df.values()
However the dataset is very large and there are thousands of unique names and I cant pivot the table due to memory constraints. Is there another way to dump the values grouped by name keeping day then time ordering?