【发布时间】:2017-08-18 17:04:39
【问题描述】:
我有两列,一列包含年份,另一列包含月份数据,我正在尝试从中创建一列(包含年份和月份)。
示例:
click_year
-----------
2016
click_month
-----------
11
我想拥有
YearMonth
-----------
201611
我试过了
date['YearMonth'] = pd.concat((date.click_year, date.click_month))
但它给了我"cannot reindex from a duplicate axis" 错误。
【问题讨论】:
-
欢迎来到 Stack Overflow!您可以先take the tour 学习How to Ask a good question 并创建Minimal, Complete, and Verifiable 示例。这让我们更容易为您提供帮助。