结合两列给出 nan 输出

Combining Two column give a nan output

我有两个数据框列 y_test 和 x_test 它们具有相同的行大小我的问题是在组合这两个数据框时我得到 y_test 列名称标签显示为nan...详细图片如下图

我用过的代码是

x_test['label'] = y_test

需要更多详细信息,请提及我会提供

我通过将 y_test(series) 转换为数组然后进行组合来解决这个难题。

y_test = np.array(y_test)
x_test['label'] = y_test

但我真的很困惑,为什么将系列和数据框结合起来显示 nan 结果?