Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions doc/source/whatsnew/v0.11.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,27 @@ Enhancements

- You can now select with a string from a DataFrame with a datelike index, in a similar way to a Series (:issue:`3070`)

.. ipython:: python
:okexcept:
.. code-block:: ipython
idx = pd.date_range("2001-10-1", periods=5, freq='M')
ts = pd.Series(np.random.rand(len(idx)), index=idx)
ts['2001']
In [30]: idx = pd.date_range("2001-10-1", periods=5, freq='M')
df = pd.DataFrame({'A': ts})
df['2001']
In [31]: ts = pd.Series(np.random.rand(len(idx)), index=idx)
In [32]: ts['2001']
Out[32]:
2001-10-31 0.117967
2001-11-30 0.702184
2001-12-31 0.414034
Freq: M, dtype: float64
In [33]: df = pd.DataFrame({'A': ts})
In [34]: df['2001']
Out[34]:
A
2001-10-31 0.117967
2001-11-30 0.702184
2001-12-31 0.414034
- ``Squeeze`` to possibly remove length 1 dimensions from an object.

Expand Down