| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| with warnings.catch_warnings() as w: | ||
| warnings.filterwarnings("ignore", | ||
| category=DeprecationWarning, | ||
| module='pandas[.*]') |
There was a problem hiding this comment.
does this mean we're just kicking the can down the road and will need yet another fix when pandas actually change this behavior?
Sorry, something went wrong.
There was a problem hiding this comment.
The change will be to raise one of the Exceptions we already catch below so we will still be happy.
Sorry, something went wrong.
There was a problem hiding this comment.
fair enough
Sorry, something went wrong.
If we catch the warning or the exception, we need to cast to numpy because later on in `_plot_args` we again use multi-dimensional indexing to up-cast to a 2D array. closes matplotlib#16295
|
@bashtage However on older versions we are not getting back a numpy array In [1]: import pandas as pd
In [2]: d = pd.Series([])
In [3]: d.index[:, None]
Out[3]: Int64Index([], dtype='int64')
In [4]: type(d.index[:, None])
Out[4]: pandas.core.indexes.numeric.Int64Index
In [5]: d.index[:, None].ndim
Out[5]: 1
In [6]: pd.__version__
Out[6]: '0.25.1'
|
Sorry, something went wrong.
| # was an unintentional quirk of pandas the above line will raise | ||
| # an exception in the future. |
There was a problem hiding this comment.
since the above line is getting deleted, this comment is no longer relevant.
Sorry, something went wrong.
There was a problem hiding this comment.
It is still relevant, the line above was moved down and put inside the context manager below.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, then it should be changed to "the line below" or moved to be next to the line it's referring to:
ndim = x[:, None].ndim #will raise exception in future
Sorry, something went wrong.
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
$ git checkout v2.2.x $ git pull
$ git cherry-pick -m1 a7501f94988b952bd97a7b382b86c924cf464f62
$ git commit -am 'Backport PR #16347: FIX: catch warnings from pandas in cbook._check_1d'
git push YOURFORK v2.2.x:auto-backport-of-pr-16347-on-v2.2.x
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Sorry, something went wrong.
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
$ git checkout v3.1.x $ git pull
$ git cherry-pick -m1 a7501f94988b952bd97a7b382b86c924cf464f62
$ git commit -am 'Backport PR #16347: FIX: catch warnings from pandas in cbook._check_1d'
git push YOURFORK v3.1.x:auto-backport-of-pr-16347-on-v3.1.x
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Sorry, something went wrong.
…k._check_1d Merge pull request matplotlib#16347 from tacaswell/fix_pandas_index_deprecation FIX: catch warnings from pandas in cbook._check_1d Conflicts: lib/matplotlib/tests/test_axes.py - new test in middle of section of tests not on v2.2.x yet, only kept new test
…k._check_1d Merge pull request matplotlib#16347 from tacaswell/fix_pandas_index_deprecation FIX: catch warnings from pandas in cbook._check_1d
…347-on-v3.2.x Backport PR #16347 on branch v3.2.x (FIX: catch warnings from pandas in cbook._check_1d)
…-v3.1.x Backport PR #16347: FIX: catch warnings from pandas in cbook._check_1d
…-v2.2.x Backport PR #16347: FIX: catch warnings from pandas in cbook._check_1d
|
So, test_bar_pandas is still failing, at least w/ #16286 which I rebased, so it should include this fix? |
Sorry, something went wrong.
|
I guess because pandas 1.0 is out? |
Sorry, something went wrong.
|
I actually don't understand. The warning is from pandas 1.0 (old pandas pass this test) and the result is: E DeprecationWarning: Support for multi-dimensional indexing (e.g. `index[:, None]`) on an Index is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead. So somehow we are no longer capturing the warning. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
If we catch the warning or the exception, we need to cast to numpy
because later on in _plot_args we again use multi-dimensional
indexing to up-cast to a 2D array.
closes #16295
PR Summary
PR Checklist