熊猫数据框并置非并置轴未对齐

时间:2018-10-02 11:23:50

标签: python pandas sorting concat

我正在合并多个具有相同列的数据框。我正在使用concat,因为它显然比附加操作更有效。数据帧的索引从0到n-1,这就是为什么我将ignore_index设置为True,以便合并的数据帧的索引从0到n-1。

df=pd.concat(dfs,ignore_index=True)

dfs是多个数据帧的python列表。

我收到此警告。

C:/Users/XXX/Documents/XX/XXX/test/football.py:512: FutureWarning: Sorting because non-concatenation axis is not aligned. A future version
of pandas will change to not sort by default.

To accept the future behavior, pass 'sort=False'.

To retain the current behavior and silence the warning, pass 'sort=True'.

  df=pd.concat(dfs,ignore_index=True)

我不确定这到底是什么意思。数据框的行数不同,但列数应相同。

non-concatenation axis is not aligned

这些是不是说所有数据框中的列都不相同?如果是这样,排序有什么作用?

0 个答案:

没有答案
相关问题