Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize horizontal connection with concat function in pandas

Shulou Source: shulou.com Published: 2022-06-01 03:01:44 11月13日 Update

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!

Tags: Horizontal function content data more article good practical two situation article look knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei OPPO Reno NVidia vpn Xiaomi