Python Forum
How to combine timeseries data under one column? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to combine timeseries data under one column? (/thread-13512.html)



How to combine timeseries data under one column? - python_newbie09 - Oct-18-2018

I have two columns A and B that consists of the same timestamps with different data, it is like 2 sensors collecting data at the same time. These two columns are in one dataframe. But now I want to have these 2 columns merged under one bigger column say C. How can I do this correctly? I have tried many ways but no luck in getting the desired output. What I have tried so far is using the below code but it is actually creating a new data frame which is not what I need.

data = pd.DataFrame({'a': df.loc[9]['b'],'b':df.loc[9]['c']}

i used .loc[9] just to see how it will be merged for one observation.

any advice will be much appreciated.


RE: How to combine timeseries data under one column? - mlieqo - Oct-20-2018

It would be easier to understand, if you could also show some part of your current dataframe, and then what would be your desired output out of that.