Repository: pandas-dev/pandas

Issue:
Inccorect example in DataFrame.to_dict docstring
`pandas.DataFrame.to_dict` documentation has incorrect example. In first example box, df.col2 is showing wrong data.

`df.col2` should = 
```
a    0.50
b    0.75
```



Discussion:
Thanks for the report! Interested in making a PR to fix it?
Yes, I'm in interested, but I also don't know how to do it. If there are
simple instructions, then I'd be happy to give it a try.

Maxim

On Fri, Feb 23, 2018 at 9:30 AM, Tom Augspurger <notifications@github.com>
wrote:

> Thanks for the report! Interested in making a PR to fix it?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/issues/19868#issuecomment-368079947>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGBUMKLvpJoHiNryxh61qFojuPePFMfaks5tXvWggaJpZM4SRNFN>
> .
>

Look at the [contributing guide](https://pandas.pydata.org/pandas-docs/stable/contributing.html)
Ok. I took a peek and the instructions are helpful and looks pretty
straightforward.  I'm on a business trip all next week though, ok if I do
this in a couple weeks?  I'd their a deadline on PR?

On Feb 23, 2018 4:46 PM, "Grant Roch" <notifications@github.com> wrote:

> Look at the contributing guide
> <https://pandas.pydata.org/pandas-docs/stable/contributing.html>
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/issues/19868#issuecomment-368180326>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGBUMPPqVpgxS0M6dFU8Sg54TXUZwrHsks5tX1v0gaJpZM4SRNFN>
> .
>

No deadline. Thanks.

________________________________
From: Maxim Kupfer <notifications@github.com>
Sent: Friday, February 23, 2018 6:54:29 PM
To: pandas-dev/pandas
Cc: Tom Augspurger; Comment
Subject: Re: [pandas-dev/pandas] Inccorect example in DataFrame.to_dict docstring (#19868)

Ok. I took a peek and the instructions are helpful and looks pretty
straightforward. I'm on a business trip all next week though, ok if I do
this in a couple weeks? I'd their a deadline on PR?

On Feb 23, 2018 4:46 PM, "Grant Roch" <notifications@github.com> wrote:

> Look at the contributing guide
> <https://pandas.pydata.org/pandas-docs/stable/contributing.html>
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/issues/19868#issuecomment-368180326>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGBUMPPqVpgxS0M6dFU8Sg54TXUZwrHsks5tX1v0gaJpZM4SRNFN>
> .
>

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://github.com/pandas-dev/pandas/issues/19868#issuecomment-368181284>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABQHIkQP62OpBoDORrproHhCHAAcc9Luks5tX13EgaJpZM4SRNFN>.


Resolving patch:
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -957,8 +957,8 @@ def to_dict(self, orient='dict', into=dict):
                 {'col1': [1, 2], 'col2': [0.5, 0.75]}, index=['a', 'b'])
         >>> df
            col1  col2
-        a     1   0.1
-        b     2   0.2
+        a     1   0.50
+        b     2   0.75
         >>> df.to_dict()
         {'col1': {'a': 1, 'b': 2}, 'col2': {'a': 0.5, 'b': 0.75}}
 


Test patch: