Skip to content

Commit 5f6db38

Browse files
committed
Removing uneeded changes
Mistakenly added changes carried out in v0.19 to v0.20
1 parent e714d8c commit 5f6db38

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

doc/source/whatsnew/v0.20.0.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,27 @@ fixed-width text files, and :func:`read_excel` for parsing Excel files.
4343
pd.read_fwf(StringIO(data)).dtypes
4444
pd.read_fwf(StringIO(data), dtype={'a':'float64', 'b':'object'}).dtypes
4545

46-
You can now pass a dictionary mapping column names to desired data types for that
47-
column to :meth:`~DataFrame.astype`.
46+
.. _whatsnew_0200.enhancements.groupby_access:
47+
48+
Groupby Enhancements
49+
^^^^^^^^^^^^^^^^^^^^
50+
51+
Strings passed to ``DataFrame.groupby()`` as the ``by`` parameter may now reference either column names or index level names (:issue:`5677`)
4852

4953
.. ipython:: python
5054

51-
dft = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6], 'c': [7, 8, 9]})
52-
dft = dft.astype({'a': np.float64, 'c': np.uint8})
53-
dft
54-
dft.dtypes
55+
arrays = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],
56+
['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two']]
57+
58+
index = pd.MultiIndex.from_arrays(arrays, names=['first', 'second'])
59+
60+
df = pd.DataFrame({'A': [1, 1, 1, 1, 2, 2, 3, 3],
61+
'B': np.arange(8)},
62+
index=index)
63+
df
64+
65+
df.groupby(['second', 'A']).sum()
66+
5567

5668
.. _whatsnew_0200.enhancements.other:
5769

0 commit comments

Comments
 (0)