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: Cast ExtensionArray to numpy ndarray before plot #25590

Merged
merged 12 commits into from
Mar 15, 2019

Conversation

sighingnow
Copy link
Contributor

Cast ExtensionArray(eg. IntegerArray) to np.ndarray before send to matplotlib to plot, fixes #25587.

Signed-off-by: HE, Tao <sighingnow@gmail.com>
@codecov
Copy link

codecov bot commented Mar 7, 2019

Codecov Report

Merging #25590 into master will increase coverage by <.01%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25590      +/-   ##
==========================================
+ Coverage   91.26%   91.26%   +<.01%     
==========================================
  Files         173      173              
  Lines       52966    52971       +5     
==========================================
+ Hits        48337    48343       +6     
+ Misses       4629     4628       -1
Flag Coverage Δ
#multiple 89.83% <80%> (ø) ⬆️
#single 41.7% <20%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/plotting/_core.py 83.64% <80%> (+0.05%) ⬆️
pandas/util/testing.py 87.66% <0%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74a9ae3...b3445fc. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 7, 2019

Codecov Report

Merging #25590 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25590      +/-   ##
==========================================
+ Coverage   91.25%   91.25%   +<.01%     
==========================================
  Files         172      172              
  Lines       52973    52976       +3     
==========================================
+ Hits        48338    48341       +3     
  Misses       4635     4635
Flag Coverage Δ
#multiple 89.82% <100%> (ø) ⬆️
#single 41.74% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/plotting/_core.py 83.64% <100%> (+0.1%) ⬆️
pandas/util/testing.py 88.98% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 998e1de...3afc9eb. Read the comment docs.

@gfyoung gfyoung added Visualization plotting ExtensionArray Extending pandas with custom dtypes or arrays. labels Mar 7, 2019
@gfyoung gfyoung requested a review from TomAugspurger March 7, 2019 18:55
Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

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

Are there any EAs we wouldn't want a regular np.asarary for? IOW, do we need to dispatch to the EA for plotting specifically?

pandas/plotting/_core.py Outdated Show resolved Hide resolved
doc/source/whatsnew/v0.24.2.rst Outdated Show resolved Hide resolved
pandas/tests/plotting/test_frame.py Outdated Show resolved Hide resolved
pandas/tests/plotting/test_frame.py Outdated Show resolved Hide resolved
Signed-off-by: HE, Tao <sighingnow@gmail.com>
Signed-off-by: HE, Tao <sighingnow@gmail.com>
@TomAugspurger
Copy link
Contributor

TomAugspurger commented Mar 11, 2019 via email

…otting.

Signed-off-by: HE, Tao <sighingnow@gmail.com>
@sighingnow
Copy link
Contributor Author

Fix the lint error and add more tests for different kinds of plotting.

@TomAugspurger I'm wondering how should I resolve the conflicts between this PR and master? Merge or rebase and push with --force?

Thanks in advance!

Signed-off-by: HE, Tao <sighingnow@gmail.com>
Signed-off-by: HE, Tao <sighingnow@gmail.com>
@teto
Copy link

teto commented Mar 13, 2019

I don't use kde and area plots so I am fine with the current PR. Hopefully it can make it before the next release.

doc/source/whatsnew/v0.24.2.rst Outdated Show resolved Hide resolved
pandas/plotting/_core.py Show resolved Hide resolved
Signed-off-by: HE, Tao <sighingnow@gmail.com>
@TomAugspurger
Copy link
Contributor

TomAugspurger commented Mar 14, 2019 via email

@sighingnow
Copy link
Contributor Author

@TomAugspurger thanks for the suggestion, but we would still get TypeError: assign() keywords must be strings.

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Mar 14, 2019 via email

Signed-off-by: HE, Tao <sighingnow@gmail.com>
Signed-off-by: HE, Tao <sighingnow@gmail.com>
doc/source/whatsnew/v0.25.0.rst Outdated Show resolved Hide resolved
pandas/plotting/_core.py Outdated Show resolved Hide resolved
* master: (22 commits)
  Fixturize tests/frame/test_operators.py (pandas-dev#25641)
  Update ValueError message in corr (pandas-dev#25729)
  DOC: fix some grammar and inconsistency issues in the User Guide (pandas-dev#25728)
  ENH: Add public start, stop, and step attributes to RangeIndex (pandas-dev#25720)
  Make Rolling.apply documentation clearer (pandas-dev#25712)
  pandas-dev#25707 - Fixed flakiness in stata write test (pandas-dev#25714)
  Json normalize nan support (pandas-dev#25619)
  TST: resolve issues with test_constructor_dtype_datetime64 (pandas-dev#24868)
  DEPR: Deprecate box kwarg for to_timedelta and to_datetime (pandas-dev#24486)
  BUG: Preserve name in DatetimeIndex.snap (pandas-dev#25585)
  Fix concat not respecting order of OrderedDict (pandas-dev#25224)
  CLN: remove pandas.core.categorical (pandas-dev#25655)
  TST/CLN: Remove more Panel tests (pandas-dev#25675)
  Pinned pycodestyle (pandas-dev#25701)
  DOC: update date of 0.24.2 release notes (pandas-dev#25699)
  BUG: Fix error in replace with strings that are large numbers (pandas-dev#25616) (pandas-dev#25644)
  BUG: fix usage of na_sentinel with sort=True in factorize() (pandas-dev#25592)
  BUG: Fix to_string output when using header (pandas-dev#16718) (pandas-dev#25602)
  CLN: Remove unused test code (pandas-dev#25670)
  CLN: remove Panel from concat error message (pandas-dev#25676)
  ...

# Conflicts:
#	doc/source/whatsnew/v0.25.0.rst
Signed-off-by: HE, Tao <sighingnow@gmail.com>
@jreback jreback added this to the 0.25.0 milestone Mar 14, 2019
@TomAugspurger TomAugspurger merged commit a61d823 into pandas-dev:master Mar 15, 2019
@TomAugspurger
Copy link
Contributor

Thanks @sighingnow!

@sighingnow sighingnow deleted the fix-25587 branch March 15, 2019 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Visualization plotting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plotting dtype "UInt32" fails
5 participants