Skip to content

Related TypeErrors in multi-indexed DataFrame #12893

Closed
@mcwitt

Description

@mcwitt

Code sample

import pandas as pd
import numpy as np

foo = pd.DataFrame(np.arange(100).reshape((10,10)))
bar = pd.DataFrame(np.arange(100).reshape((10,10)))

df = pd.concat({
        'foo': foo.stack(),
        'bar': bar.stack()
    }, axis=1)

df.index.names = ['fizz','buzz']

Output

> df
TypeError: data type "fizz" not understood

> df_ = df.set_index('foo', append=True)  # shouldn't call __repr__
TypeError: data type "fizz" not understood

> df[:61]
TypeError: data type "fizz" not understood

> df[:60]
           bar  foo
fizz buzz          
0    0       0    0
     1       1    1
     2       2    2
...

show_versions() output

> pd.show_versions()

INSTALLED VERSIONS
------------------
commit: 2ba977a917ac5c092378a2f172f59d53b14de968
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.0+111.g2ba977a
nose: None
pip: 8.1.1
setuptools: 20.6.7
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.1.2
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: 0.9.2
apiclient: 1.5.0
sqlalchemy: None
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
pandas_datareader: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCompatpandas objects compatability with Numpy or Python functionsMultiIndex

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions