Skip to content

DOC: fix doc for crosstab with Categorical data input #33783

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

Merged
merged 3 commits into from
Apr 27, 2020
Merged

DOC: fix doc for crosstab with Categorical data input #33783

merged 3 commits into from
Apr 27, 2020

Conversation

GYHHAHA
Copy link
Contributor

@GYHHAHA GYHHAHA commented Apr 25, 2020

Crosstab function should set dropna=False to keep the categories which not appear in the data, but in the DOC, it seems to be inconsistent with the description. Two examples for comparison may be better for users to get this point.

https://pandas.pydata.org/docs/dev/user_guide/reshaping.html#cross-tabulations

@alimcmaster1
Copy link
Member

Thanks for the PR.

Looks like there are some minor fixes:

Check that no file in the repo contains trailing whitespaces
##[error]doc/source/user_guide/reshaping.rst:475:categories included in the cross-tabulation while setting ``dropna=False``,  <- trailing whitespaces found

@GYHHAHA
Copy link
Contributor Author

GYHHAHA commented Apr 26, 2020

Hi, whether I need to close this pull and create another? Thanks, this is my first PR, not very sophisticated about the process.

@GYHHAHA
Copy link
Contributor Author

GYHHAHA commented Apr 26, 2020

Oh, I find it start automatically after the push step. Thanks!

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Apr 26, 2020

Thanks @GYHHAHA ! Could you please include a screenshot of this part of the docs? See building the documentation

If you're in the doc directory, something like this should work:

python make.py clean
python make.py --single user_guide/reshaping.rst 

@GYHHAHA
Copy link
Contributor Author

GYHHAHA commented Apr 26, 2020

Hi, this is the screenshot. Is it OK? Thanks! @MarcoGorelli
pull_reshaping_doc


.. ipython:: python

foo = pd.Categorical(['a', 'b'], categories=['a', 'b', 'c'])
bar = pd.Categorical(['d', 'e'], categories=['d', 'e', 'f'])
pd.crosstab(foo, bar)
pd.crosstab(foo, bar, dropna=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

can u put this one in a separate ipython block and put the comment before that one

@jreback jreback added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Apr 27, 2020
@GYHHAHA
Copy link
Contributor Author

GYHHAHA commented Apr 27, 2020

Hi, this is the screenshot under current status. Thanks for review! @jreback
crosstab_cate

@jreback jreback added this to the 1.1 milestone Apr 27, 2020
@jreback
Copy link
Contributor

jreback commented Apr 27, 2020

lgtm long on green

@GYHHAHA
Copy link
Contributor Author

GYHHAHA commented Apr 27, 2020

Checks are down, is it ok? Thanks! @jreback

@jreback jreback merged commit 5ef5dfb into pandas-dev:master Apr 27, 2020
@jreback
Copy link
Contributor

jreback commented Apr 27, 2020

thanks

@GYHHAHA GYHHAHA deleted the gyh-pandas branch April 27, 2020 02:17
rhshadrach pushed a commit to rhshadrach/pandas that referenced this pull request May 10, 2020
* fix doc for crosstab with Categorical data input

* fix doc for crosstab with Categorical data input

* put dropna=False in a separate ipython block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants