pandas concat('outer')不做工会吗? [英] pandas concat('outer') not doing union?

查看:83
本文介绍了 pandas concat('outer')不做工会吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来pandas.concat正在执行左外部"连接,而不是仅合并索引.对我来说似乎是个错误,但也许我缺少明显的东西.

It looks pandas.concat is doing 'left outer' join instead of just union the indexes. Seems a bug to me but maybe I'm missing something obvious.

    import pandas
    import pandas.util.testing as put
    ts1 = put.makeTimeSeries()
    ts2 = put.makeTimeSeries()[::2]
    ts3 = put.makeTimeSeries()[::3]
    ts4 = put.makeTimeSeries()[::4]

    ## to join with union
    ## these two are of different length!
    pandas.concat([ts1,ts2], join='outer', axis = 1) 
    pandas.concat([ts2,ts1], join='outer', axis = 1)

任何想法我如何获得完整的联合(因为他们确实通过在熊猫文件上使用join ='outer'声明了所有权)

Any idea how can I get the full union (as they do claim by using join='outer' on the pandas document)

谢谢.

推荐答案

这是一个错误.在这里打开了一个问题:

It's a bug. Opened an issue here:

http://github.com/pydata/pandas/issues/1719

(请使用GitHub进行熊猫错误报告)

(Please use GitHub for pandas bug reports)

这篇关于 pandas concat('outer')不做工会吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆