gpt4 book ai didi

Python:合并两列

转载 作者:太空宇宙 更新时间:2023-11-04 06:41:30 24 4
gpt4 key购买 nike

<分区>

我有两列,一列有年份,另一列有月份数据,我正在尝试从中创建一列(包含年份和月份)。
示例:

click_year  
-----------
2016

click_month
-----------
11

我想拥有

YearMonth 
-----------
201611

我试过了

date['YearMonth'] = pd.concat((date.click_year, date.click_month)) 

但它给了我“无法从重复轴重新索引”错误。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com