Skip to content

ERROR: test_constructor_unsortable (pandas.tests.test_categorical.TestCategorical) #11388

Closed
@jlec

Description

@jlec
======================================================================
ERROR: test_constructor_unsortable (pandas.tests.test_categorical.TestCategorical)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/pandas-0.17.0/work/pandas-0.17.0-python3_4/lib/pandas/core/algorithms.py", line 198, in factorize
    sorter = uniques.argsort()
TypeError: unorderable types: datetime.datetime() > int()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/pandas-0.17.0/work/pandas-0.17.0-python3_4/lib/pandas/core/categorical.py", line 265, in __init__
    codes, categories = factorize(values, sort=True)
  File "/var/tmp/portage/dev-python/pandas-0.17.0/work/pandas-0.17.0-python3_4/lib/pandas/core/algorithms.py", line 207, in factorize
    lambda x: isinstance(x,string_types) ]
  File "/var/tmp/portage/dev-python/pandas-0.17.0/work/pandas-0.17.0-python3_4/lib/pandas/core/algorithms.py", line 206, in <listcomp>
    np.sort(np.array([ e for i, e in enumerate(uniques) if f(e) ],dtype=object)) for f in [ lambda x: not isinstance(x,string_types),
  File "/usr/lib64/python3.4/site-packages/numpy/core/fromnumeric.py", line 819, in sort
    a.sort(axis, kind, order)
TypeError: unorderable types: datetime.datetime() > int()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/pandas-0.17.0/work/pandas-0.17.0-python3_4/lib/pandas/tests/test_categorical.py", line 94, in test_constructor_unsortable
    Categorical.from_array(arr, ordered=True)
  File "/var/tmp/portage/dev-python/pandas-0.17.0/work/pandas-0.17.0-python3_4/lib/pandas/core/categorical.py", line 351, in from_array
    return Categorical(data, **kwargs)
  File "/var/tmp/portage/dev-python/pandas-0.17.0/work/pandas-0.17.0-python3_4/lib/pandas/core/categorical.py", line 271, in __init__
    raise TypeError("'values' is not ordered, please explicitly specify the "
TypeError: 'values' is not ordered, please explicitly specify the categories order by passing in a categories argument.

----------------------------------------------------------------------
Ran 9056 tests in 1000.617s
INSTALLED VERSIONS
------------------
commit: None
python: 3.4.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.1.9-lh
machine: x86_64
processor: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
byteorder: little
LC_ALL: None
LANG: en_GB.utf8

pandas: 0.17.0
nose: 1.3.7
pip: 7.1.2
setuptools: 18.4
Cython: 0.23.4
numpy: 1.10.1
scipy: 0.16.0
statsmodels: 0.6.1
IPython: None
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.6
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.4
matplotlib: 1.4.3
openpyxl: 2.2.6
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: 3.4.4
bs4: 4.4.1
html5lib: 0.9999999
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.0.8
pymysql: 0.6.7.None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Testingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions