Skip to content

numpy FutureWarning in df.equals #8509

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

From the example in the v0.13.1 whatsnew docs (http://pandas.pydata.org/pandas-docs/version/0.15.0/whatsnew.html#id12):

df = DataFrame({'col':['foo', 0, np.nan]}).sort()
df2 = DataFrame({'col':[np.nan, 0, 'foo']}, index=[2,1,0])
df.equals(df)

gives:

In [3]: df.equals(df)
C:\Anaconda\lib\site-packages\numpy\core\numeric.py:2367: FutureWarning: numpy e
qual will not check object identity in the future. The comparison did not return
 the same result as suggested by the identity (`is`)) and will change.
  return bool(asarray(a1 == a2).all())
Out[3]: True

The example in basics.rst section does not have this warning (http://pandas.pydata.org/pandas-docs/version/0.15.0/basics.html#comparing-if-objects-are-equivalent):

df = DataFrame({'one' : Series(randn(3), index=['a', 'b', 'c']),
                'two' : Series(randn(4), index=['a', 'b', 'c', 'd']),
                'three' : Series(randn(3), index=['b', 'c', 'd'])})
(df+df).equals(df*2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions