Skip to content

Related TypeErrors in multi-indexed DataFrame #12893

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
mcwitt opened this issue Apr 13, 2016 · 1 comment
Closed

Related TypeErrors in multi-indexed DataFrame #12893

mcwitt opened this issue Apr 13, 2016 · 1 comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions MultiIndex
Milestone

Comments

@mcwitt
Copy link
Contributor

mcwitt commented Apr 13, 2016

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
@mcwitt mcwitt changed the title TypeError when showing > 60 rows of multi-indexed DataFrame Related TypeErrors in multi-indexed DataFrame Apr 13, 2016
@jreback
Copy link
Contributor

jreback commented Apr 13, 2016

this is a bug in index coercion when falling back from RangeIndex construction. thanks for the example.

@jreback jreback added Bug MultiIndex Compat pandas objects compatability with Numpy or Python functions Difficulty Advanced labels Apr 13, 2016
@jreback jreback added this to the 0.18.1 milestone Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions MultiIndex
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants