Skip to content

array_equivalent has disappeared from pandas.core.common in version 0.19, is this a mistake? #14555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cleemesser opened this issue Nov 2, 2016 · 9 comments
Labels
Deprecate Functionality to remove in pandas

Comments

@cleemesser
Copy link

A small, complete example of the issue

# Your code here
import pandas
import pandas.core.common as com
print com.array_equivalent

Expected Output

# expect something like:
# <function array_equivalent at 0x000000000445A198>
# But I get
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-fc6fc07906df> in <module>()
----> 1 print com.array_equivalent

AttributeError: 'module' object has no attribute 'array_equivalent'

Output of pd.show_versions()

# Paste the output here pd.show_versions() here INSTALLED VERSIONS ------------------ commit: None python: 2.7.11.final.0 python-bits: 64 OS: Windows OS-release: 7 machine: AMD64 processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: None.None

pandas: 0.19.0
nose: 1.3.7
pip: 8.1.2
setuptools: 23.0.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.17.1
statsmodels: 0.6.1
xarray: None
IPython: 4.1.2
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.6.1
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.0
pandas_datareader: None

@jreback
Copy link
Contributor

jreback commented Nov 2, 2016

you can import it from pandas.types.missing. its not really a public method. though @jorisvandenbossche and I did have this discussion.

@jorisvandenbossche
Copy link
Member

Well, there are two aspect about this:

First, that we didn't add a deprecation warning for array_equivalent (as we did for the other functions in pd.core.common. This can be easily fixed.

Secondly about the fact that we currently don't plan to make this public (opposed to other functions in pd.core.common), and so it is not recommended to use it (although you can now import it from pd.types.missing, we don't guarantee this will keep working).
But if it is regarded as useful functionality, we can consider to making it public.

@tomspur
Copy link

tomspur commented Nov 2, 2016

array_equivalent is already used in the docs, which fails now with a traceback:
image

@jorisvandenbossche
Copy link
Member

@tomspur yes, we are aware of that (and I forgot to remove it from the docs for the 0.19.0 release)

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Nov 2, 2016

This functionality should actually be rather available from numpy. The problem is, however, that np.array_equal or np.array_equiv do not handle NaNs well.
But I see that numpy 1.10 added a equal_nan keyword to np.allclose, so you can do:

>>> np.allclose([1.0, np.nan], [1.0, np.nan], equal_nan=True)
True

https://docs.scipy.org/doc/numpy/reference/generated/numpy.allclose.html

We can probably recommend that as alternative

@jreback
Copy link
Contributor

jreback commented Nov 2, 2016

i don't think that handles object dtypes (with or w/o nans)

@jorisvandenbossche
Copy link
Member

Ah, yes, and also no datetime64 values. OK, clearly not a full replacement

@jbrockmendel
Copy link
Member

Is this actionable? Closeable?

@jorisvandenbossche
Copy link
Member

The core.common deprecations have already been removed before. And there has been no further discussion (or requests) to make array_equivalent public, so closing.

@jorisvandenbossche jorisvandenbossche added this to the No action milestone Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

No branches or pull requests

5 participants