-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: plotting methods can unpack labeled data #4829
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
Changes from 1 commit
367b68f
34b879a
9f145cc
a1c9c34
1e04469
d6e177f
8a77f90
dbd3445
1ae230d
ab6d39c
6e29d39
f488bc7
1543cde
f4eea6e
c4a6044
4d1ffb8
c78bb92
d3331ca
ea3e22d
3273673
346a014
85d0e74
1f36892
8dbb2cc
c768f0d
385b8e3
812f74f
2194e80
52d23c9
8aa800b
ecc91e5
b09370e
0f781a1
77be376
7a39ef6
a0c738e
7a6d44d
bb4b9f7
9c1199b
47ff38a
00929b9
b6cb12f
25b1d43
b4f011c
61eb622
e838a25
55ed86e
9846b9c
2b2092d
572c1e2
e2cf264
67fda44
59f3917
1c9feb8
1d00767
c454983
0d6cd40
0734b86
5fbe4b0
f34aed0
a051b57
8271952
0b4fc7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Working with labeled data like pandas DataFrames | ||
------------------------------------------------ | ||
Plot methods which take arrays as inputs can now also work with labeled data | ||
and unpack such data. | ||
|
||
This means that the following two examples produce the same plot:: | ||
|
||
Example :: | ||
df = pandas.DataFrame({"var1":[1,2,3,4,5,6], "var2":[1,2,3,4,5,6]}) | ||
plt.plot(df["var1"], df["var2"]) | ||
|
||
|
||
Example :: | ||
plt.plot("var1", "var2", data=df) | ||
|
||
This works for most plotting methods, which expect arrays/sequences as | ||
inputs and ``data`` can be anything which supports ``__get_item__`` | ||
(``dict``, ``pandas.DataFrame``,...). | ||
|
||
In addition to this, some other changes were made, which makes working with | ||
``pandas.DataFrames`` easier: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
|
||
* For plotting methods which understand a ``label`` keyword argument but the | ||
user does not supply such an argument, this is now implicitly set by either | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which of these two methods for looking up a label takes priority? It's not clear to me from the description here.... |
||
looking up ``.name`` of the right input or by using the label supplied to | ||
lookup the input in ``data``. In the above examples, this results in an | ||
implicit ``label="var2"`` for both cases. | ||
|
||
* ``plot()`` now uses the index of a ``Series`` instead of | ||
``np.arange(len(y))``, if no ``x`` argument is supplied. |
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 be
__getitem__