Check if multiple pd.DataFrames are equal

一笑奈何 提交于 2021-02-10 06:22:19

问题


Is there a Pythonic way (no loops or recursion) to check if more than two pd.DataFrames (e.g., a list of pd.DataFrames) are equal to each other?


回答1:


Something like:

all(x.equals(dfs[0]) for x in dfs)

with dfs the list of dataframes. This checks if they are all equal to the first - which I think is equivalent to asking if they are all equal to one another.



来源:https://stackoverflow.com/questions/60452817/check-if-multiple-pd-dataframes-are-equal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!