-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Add support for DataFrame(ExtensionArray) #30305
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
ENH: Add support for DataFrame(ExtensionArray) #30305
Conversation
pandas/core/frame.py
Outdated
@@ -450,7 +450,7 @@ def __init__( | |||
|
|||
# For data is list-like, or Iterable (will consume into list) | |||
elif isinstance(data, abc.Iterable) and not isinstance(data, (str, bytes)): | |||
if not isinstance(data, abc.Sequence): | |||
if not isinstance(data, (abc.Sequence, Categorical)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be any extension dtype? Not just categorical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomAugspurger
Yes. you are right. Thank you for pointing out. So I change it. Also add test case too except "DatetimeArray" and "TimedeltaArray". Because these are currently experimental and also these have no reshape method so can't use "assert_frame_equal".
fb6a3ee
to
8d1abe2
Compare
8d1abe2
to
35d502f
Compare
Thanks, @proost |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Problem:
In core.frame
Categorical Object cast as list. So In core.construction it is not identified as Categorical.