Skip to content

creating Panel from dict of DataFrames loses dtypes #359

@CRP

Description

@CRP

in the example below, "a" is a mixed type dataframe. Once included in the Panel, all columns become of type object:

In [249]: a=DataFrame(randn(30,3),columns=('a','b','c'))

In [250]: b=DataFrame(randn(30,3),columns=('a','b','c'))

In [251]: a['b']=a['b'].astype(object)

In [252]: a.dtypes
Out[252]:
a float64
b object
c float64

In [253]: b.dtypes
Out[253]:
a float64
b float64
c float64

In [254]: Panel({'1':a,'2':b})['1'].dtypes
Out[254]:
a object
b object
c object

In [255]: Panel({'1':a,'2':b})['2'].dtypes
Out[255]:
a float64
b float64
c float64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions