BUG: sorting with tuples and Multi-Index creation · Issue #10697 · pandas-dev/pandas (original) (raw)

Hello,

I'm using python 2.7.9 and pandas 0.15.2.
I'm trying to concatenate two DataFrames (to_concat is a list of 2 DataFrames) and I have the following error.

  File "/Users/alexisbenoist/Documents/CoTH/AFDS/app/core.py", line 67, in train_dataflow
    df = pd.concat(to_concat)
  File "/Users/alexisbenoist/.virtualenvs/afds/lib/python2.7/site-packages/pandas/tools/merge.py", line 725, in concat
    return op.get_result()
  File "/Users/alexisbenoist/.virtualenvs/afds/lib/python2.7/site-packages/pandas/tools/merge.py", line 896, in get_result
    mgrs_indexers, self.new_axes, concat_axis=self.axis, copy=self.copy)
  File "/Users/alexisbenoist/.virtualenvs/afds/lib/python2.7/site-packages/pandas/core/internals.py", line 4046, in concatenate_block_managers
    for placement, join_units in concat_plan]
  File "/Users/alexisbenoist/.virtualenvs/afds/lib/python2.7/site-packages/pandas/core/internals.py", line 4135, in concatenate_join_units
    empty_dtype, upcasted_na = get_empty_dtype_and_na(join_units)
  File "/Users/alexisbenoist/.virtualenvs/afds/lib/python2.7/site-packages/pandas/core/internals.py", line 4124, in get_empty_dtype_and_na
    raise AssertionError("invalid dtype determination in get_concat_dtype")
AssertionError: invalid dtype determination in get_concat_dtype

I put the pickle of the DataFrames in a gist using (I can upload it somewhere else if it's more convenient).

import pickle
with open(path, 'w+') as f:
    pickle.dump(to_concat, f)

I feel that I'm doing something wrong or it's a bug from pandas because if do:

pd.DataFrame(np.concatenate(to_concat), columns=to_concat[0].columns.tolist())

It gives a result which seems logical.

Any input is welcome.

Cheers,
Alexis.