inner join/merge in pandas dataframe give more rows than left dataframe

筅森魡賤 提交于 2019-12-02 01:22:24

Only way I can see this happening... particularly with the 14,000 being the same exact number as the number of records in df2 is if the column combination in df2 are not unique.

You can verify that they are not unique with the following (True if unique)

df2.duplicated(['device number', 'date']).sum() == 0

Or

df.set_index(['device number', 'date']).index.is_unique
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!