Skip to content

Commit b67a4b5

Browse files
committed
Fix code-block
1 parent c529863 commit b67a4b5

File tree

2 files changed

+61
-59
lines changed

2 files changed

+61
-59
lines changed

doc/source/whatsnew/v0.20.0.rst

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -677,65 +677,65 @@ data-types would yield different return types. These are now made consistent. (:
677677

678678
- Datetime tz-aware
679679

680-
Previous behaviour:
680+
Previous behaviour:
681681

682-
.. code-block:: ipython
682+
.. code-block:: ipython
683683
684-
# Series
685-
In [5]: pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
686-
...: pd.Timestamp('20160101', tz='US/Eastern')]).unique()
687-
Out[5]: array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')], dtype=object)
684+
# Series
685+
In [5]: pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
686+
...: pd.Timestamp('20160101', tz='US/Eastern')]).unique()
687+
Out[5]: array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')], dtype=object)
688688
689-
In [6]: pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
690-
...: pd.Timestamp('20160101', tz='US/Eastern')]))
691-
Out[6]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
689+
In [6]: pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
690+
...: pd.Timestamp('20160101', tz='US/Eastern')]))
691+
Out[6]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
692692
693-
# Index
694-
In [7]: pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
695-
...: pd.Timestamp('20160101', tz='US/Eastern')]).unique()
696-
Out[7]: DatetimeIndex(['2016-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq=None)
693+
# Index
694+
In [7]: pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
695+
...: pd.Timestamp('20160101', tz='US/Eastern')]).unique()
696+
Out[7]: DatetimeIndex(['2016-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq=None)
697697
698-
In [8]: pd.unique([pd.Timestamp('20160101', tz='US/Eastern'),
699-
...: pd.Timestamp('20160101', tz='US/Eastern')])
700-
Out[8]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
698+
In [8]: pd.unique([pd.Timestamp('20160101', tz='US/Eastern'),
699+
...: pd.Timestamp('20160101', tz='US/Eastern')])
700+
Out[8]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
701701
702-
New Behavior:
702+
New Behavior:
703703

704-
.. ipython:: python
704+
.. ipython:: python
705705
706-
# Series, returns an array of Timestamp tz-aware
707-
pd.Series([pd.Timestamp(r'20160101', tz=r'US/Eastern'),
708-
pd.Timestamp(r'20160101', tz=r'US/Eastern')]).unique()
709-
pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
710-
pd.Timestamp('20160101', tz='US/Eastern')]))
706+
# Series, returns an array of Timestamp tz-aware
707+
pd.Series([pd.Timestamp(r'20160101', tz=r'US/Eastern'),
708+
pd.Timestamp(r'20160101', tz=r'US/Eastern')]).unique()
709+
pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
710+
pd.Timestamp('20160101', tz='US/Eastern')]))
711711
712-
# Index, returns a DatetimeIndex
713-
pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
714-
pd.Timestamp('20160101', tz='US/Eastern')]).unique()
715-
pd.unique(pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
716-
pd.Timestamp('20160101', tz='US/Eastern')]))
712+
# Index, returns a DatetimeIndex
713+
pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
714+
pd.Timestamp('20160101', tz='US/Eastern')]).unique()
715+
pd.unique(pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
716+
pd.Timestamp('20160101', tz='US/Eastern')]))
717717
718718
- Categoricals
719719

720-
Previous behaviour:
720+
Previous behaviour:
721721

722-
.. code-block:: ipython
722+
.. code-block:: ipython
723723
724-
In [1]: pd.Series(list('baabc'), dtype='category').unique()
725-
Out[1]:
726-
[b, a, c]
727-
Categories (3, object): [b, a, c]
724+
In [1]: pd.Series(list('baabc'), dtype='category').unique()
725+
Out[1]:
726+
[b, a, c]
727+
Categories (3, object): [b, a, c]
728728
729-
In [2]: pd.unique(pd.Series(list('baabc'), dtype='category'))
730-
Out[2]: array(['b', 'a', 'c'], dtype=object)
729+
In [2]: pd.unique(pd.Series(list('baabc'), dtype='category'))
730+
Out[2]: array(['b', 'a', 'c'], dtype=object)
731731
732-
New Behavior:
732+
New Behavior:
733733

734-
.. ipython:: python
734+
.. ipython:: python
735735
736-
# returns a Categorical
737-
pd.Series(list('baabc'), dtype='category').unique()
738-
pd.unique(pd.Series(list('baabc'), dtype='category'))
736+
# returns a Categorical
737+
pd.Series(list('baabc'), dtype='category').unique()
738+
pd.unique(pd.Series(list('baabc'), dtype='category'))
739739
740740
.. _whatsnew_0200.api_breaking.s3:
741741

@@ -1081,48 +1081,48 @@ joins, :meth:`DataFrame.join` and :func:`merge`, and the ``.align`` method.
10811081

10821082
.. ipython:: python
10831083
1084-
left = pd.Index([2, 1, 0])
1085-
left
1086-
right = pd.Index([1, 2, 3])
1087-
right
1084+
left = pd.Index([2, 1, 0])
1085+
left
1086+
right = pd.Index([1, 2, 3])
1087+
right
10881088
10891089
Previous Behavior:
10901090

10911091
.. code-block:: ipython
10921092
1093-
In [4]: left.intersection(right)
1094-
Out[4]: Int64Index([1, 2], dtype='int64')
1093+
In [4]: left.intersection(right)
1094+
Out[4]: Int64Index([1, 2], dtype='int64')
10951095
10961096
New Behavior:
10971097

10981098
.. ipython:: python
10991099
1100-
left.intersection(right)
1100+
left.intersection(right)
11011101
11021102
- ``DataFrame.join`` and ``pd.merge``
11031103

11041104
.. ipython:: python
11051105
1106-
left = pd.DataFrame({'a': [20, 10, 0]}, index=[2, 1, 0])
1107-
left
1108-
right = pd.DataFrame({'b': [100, 200, 300]}, index=[1, 2, 3])
1109-
right
1106+
left = pd.DataFrame({'a': [20, 10, 0]}, index=[2, 1, 0])
1107+
left
1108+
right = pd.DataFrame({'b': [100, 200, 300]}, index=[1, 2, 3])
1109+
right
11101110
11111111
Previous Behavior:
11121112

11131113
.. code-block:: ipython
11141114
1115-
In [4]: left.join(right, how='inner')
1116-
Out[4]:
1117-
a b
1118-
1 10 100
1119-
2 20 200
1115+
In [4]: left.join(right, how='inner')
1116+
Out[4]:
1117+
a b
1118+
1 10 100
1119+
2 20 200
11201120
11211121
New Behavior:
11221122

11231123
.. ipython:: python
11241124
1125-
left.join(right, how='inner')
1125+
left.join(right, how='inner')
11261126
11271127
.. _whatsnew_0200.api_breaking.pivot_table:
11281128

doc/source/whatsnew/v0.21.0.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ First we set the data:
245245
n = 1000
246246
df = pd.DataFrame({'Store': np.random.choice(['Store_1', 'Store_2'], n),
247247
'Product': np.random.choice(['Product_1',
248-
'Product_2', 'Product_3'], n),
248+
'Product_2',
249+
'Product_3'
250+
], n),
249251
'Revenue': (np.random.random(n) * 50 + 10).round(2),
250252
'Quantity': np.random.randint(1, 10, size=n)})
251253
df.head(2)

0 commit comments

Comments
 (0)