Problem:
I'd like to take Series 1 and Series 2 and create a new Series with values (series 1, Series 2). Essentially, I have two pandas series that I would like to combine into one. Although the values are represented as ints
they are factors
.
Ex.
Series 1 Series 2 Series 3
1 2 --- (1,2)
2 3 to (2,3)
3 4 --- (3,4)
What I've tried
pandas: combine two columns in a DataFrame
The pandas functions:
concat
, merge
, join
So far I've only been able to combine the values, (ie. add the elements together, append the series to each other, or merge based on values). Because the dataset is large, I'm looking to avoid loops. Although thats the only way I can think to do it so far. I feel like this should be pretty easy to accomplish with the power of pandas.
Any ideas? thanks for taking a look!