I have a dataframe read from csv file, it similar to the following:
LIST-1 LIST-2 LIST-3 ... LIST-N
TIME
2017-06-21 00:17:00 NaN [99.221] [42.357, 102.665]
2017-06-21 00:18:00 NaN [50.89] [42.357, 43.125,...]
2017-06-21 00:19:00 NaN [61.50, 76.1] [70.163, 121.486]
2017-06-21 00:20:00 [70.16] NaN NaN
2017-06-21 00:21:00 NaN [102.665] [57.9, 63.66, 68.7...
Each line represents one minute of data, the dtype of list_N column is object. I want to do the :
- Merge all the lists in each row into a float list and use the list as a new column--
ALL_LIST; - Then, merge the thirty minutes of data( (that is, thirty rows of data--
ALL_LIST) ) into a new list; Finally, I want to get a dataframe like this:
TIME LIST 2017-06-21 00:00:00 [99.221,42.357, 42.357, ...] 2017-06-21 00:30:00 [52.328,42.357, 49.169, ...] 2017-06-21 01:00:00 [61.484,42.357, 76.52, ...] 2017-06-21 01:30:00 [76.523,42.357, 121.486, ...]