How to realize horizontal connection with concat function in pandas
This article is about how the concat function in pandas implements horizontal concatenation. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
transverse connecting
In [10]: pd.concat([df1, df2], axis=1)Out[10]: letter number letter number0 a 1 c 31 b 2 d 4
By default, concat is union, and if one of the two pieces of data does not have a corresponding row or column, it will be filled with a null value NaN.
Thank you for reading! About "how to achieve horizontal connection in pandas concat function" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!