Skip to content

Commit 42fe25f

Browse files
jrebackAnkurDedania
authored andcommitted
DOC: typo in merge.rst
1 parent 6bc9ea9 commit 42fe25f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

doc/source/categorical.rst

+1
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ Assigning a `Categorical` to parts of a column of other types will use the value
617617
df
618618
df.dtypes
619619
620+
.. _categorical.merge:
620621

621622
Merging
622623
~~~~~~~

doc/source/merging.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ resulting dtype will be upcast.
779779
780780
.. versionadded:: 0.20.0
781781

782-
Merging will preserve ``category`` dtypes of the mergands.
782+
Merging will preserve ``category`` dtypes of the mergands. See also the section on :ref:`categoricals <categorical.merge>`
783783

784784
The left frame.
785785

@@ -788,17 +788,17 @@ The left frame.
788788
X = pd.Series(np.random.choice(['foo', 'bar'], size=(10,)))
789789
X = X.astype('category', categories=['foo', 'bar'])
790790
791-
left = DataFrame({'X': X,
792-
'Y': np.random.choice(['one', 'two', 'three'], size=(10,))})
791+
left = pd.DataFrame({'X': X,
792+
'Y': np.random.choice(['one', 'two', 'three'], size=(10,))})
793793
left
794794
left.dtypes
795795
796796
The right frame.
797797

798798
.. ipython:: python
799799
800-
right = DataFrame({'X': Series(['foo', 'bar']).astype('category', categories=['foo', 'bar']),
801-
'Z': [1, 2]})
800+
right = pd.DataFrame({'X': Series(['foo', 'bar']).astype('category', categories=['foo', 'bar']),
801+
'Z': [1, 2]})
802802
right
803803
right.dtypes
804804

0 commit comments

Comments
 (0)