Oct-18-2018, 04:28 PM
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.
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.