Stack two Pandas series vertically and horizontally
In this article we’ll see how we can stack two Pandas series both vertically and horizontally. We stack these lists to combine some data in a DataFrame for a better visualization of the data, combining different data, etc. Now let’s see with the help of examples how we can do this.
Stacking Horizontally : We can stack 2 Pandas series horizontally by passing them in the pandas.concat() with the parameter
axis = 1.
Stacking Vertically : We can stack 2 Pandas series vertically by passing them in the
pandas.concat() with the parameter
axis = 0.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course