Skip to content
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

BUG: #14016. Preserve categorical keys through concat #14035

Closed
wants to merge 2 commits into from
Closed

BUG: #14016. Preserve categorical keys through concat #14035

wants to merge 2 commits into from

Conversation

tom-bird
Copy link
Contributor

@@ -1637,7 +1640,10 @@ def _make_concat_multiindex(indexes, keys, levels=None, names=None):
else:
levels = [_ensure_index(x) for x in levels]
else:
zipped = [keys]
if isinstance(keys, cat.CategoricalIndex):
zipped = lzip(*keys)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is way too special casey; needs a more general soln.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree, but not obvious to me what it should be

@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Categorical Categorical Data Type labels Aug 18, 2016
@jreback
Copy link
Contributor

jreback commented Sep 9, 2016

can you rebase / update?

@jreback
Copy link
Contributor

jreback commented Nov 16, 2016

can you rebase / update

@jreback
Copy link
Contributor

jreback commented Dec 26, 2016

can you rebase?

@@ -1367,7 +1367,10 @@ def __init__(self, objs, axis=0, join='outer', join_axes=None,
clean_keys.append(k)
clean_objs.append(v)
objs = clean_objs
keys = clean_keys
if isinstance(keys, cat.CategoricalIndex):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a rebase, but I think this would almost work as-is, as IIRC we do something like
keys = _ensure_index(keys) already

@jreback
Copy link
Contributor

jreback commented Jan 21, 2017

rebase this, some other changes may have fixed / made this easier.

@jreback
Copy link
Contributor

jreback commented Mar 20, 2017

can you rebase / update?

@jreback
Copy link
Contributor

jreback commented Apr 18, 2017

can you rebase

@jreback
Copy link
Contributor

jreback commented May 13, 2017

closing as stale

@jreback jreback closed this May 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: concat with categorical keys doesn't preserve categorical dtype
2 participants