考试报名
考试报名
考试内容
考试大纲
在线客服
返回顶部

备考刷题,请到

CDA认证小程序

"现有数据集df1、df2: import pandas as pd df1 = pd.DataFrame({'A': [1, 2]}, index=['x', 'y']) df2 = pd.DataFrame({'A': [3, 4]}, index=['y', 'z']) res = pd.concat([df1, df2], axis=1) res 的结果中索引index是什么?"
A. ['x', 'y', 'z']
B. ['y']
C. [0, 1]
D. [0, 1, 2, 3]
上一题
下一题
收藏
点赞
评论
题目解析
题目评论(0)

concat(axis=1) 横向合并列,行索引自动对齐并取并集。所以最终index是['x', 'y', 'z']