Skip to content

Commit b089fa0

Browse files
committed
resolve conflict in whatsnew/v2.1.0.rst
2 parents d8c7fd7 + c65c8dd commit b089fa0

File tree

80 files changed

+3347
-2058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3347
-2058
lines changed

.github/workflows/unit-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ jobs:
337337
run: |
338338
python --version
339339
python -m pip install --upgrade pip setuptools wheel
340-
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
340+
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
341341
python -m pip install git+https://github.com/nedbat/coveragepy.git
342342
python -m pip install versioneer[toml]
343343
python -m pip install python-dateutil pytz cython hypothesis>=6.46.1 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-cov pytest-asyncio>=0.17

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
157157
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
158158
# trigger an upload to
159-
# https://anaconda.org/scipy-wheels-nightly/pandas
159+
# https://anaconda.org/scientific-python-nightly-wheels/pandas
160160
# for cron jobs or "Run workflow" (restricted to main branch).
161161
# Tags will upload to
162162
# https://anaconda.org/multibuild-wheels-staging/pandas

ci/code_checks.sh

+1-44
Original file line numberDiff line numberDiff line change
@@ -263,50 +263,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
263263
pandas.core.window.ewm.ExponentialMovingWindow.cov \
264264
pandas.api.indexers.BaseIndexer \
265265
pandas.api.indexers.VariableOffsetWindowIndexer \
266-
pandas.core.groupby.DataFrameGroupBy.count \
267-
pandas.core.groupby.DataFrameGroupBy.cummax \
268-
pandas.core.groupby.DataFrameGroupBy.cummin \
269-
pandas.core.groupby.DataFrameGroupBy.cumprod \
270-
pandas.core.groupby.DataFrameGroupBy.cumsum \
271-
pandas.core.groupby.DataFrameGroupBy.diff \
272-
pandas.core.groupby.DataFrameGroupBy.ffill \
273-
pandas.core.groupby.DataFrameGroupBy.max \
274-
pandas.core.groupby.DataFrameGroupBy.median \
275-
pandas.core.groupby.DataFrameGroupBy.min \
276-
pandas.core.groupby.DataFrameGroupBy.ohlc \
277-
pandas.core.groupby.DataFrameGroupBy.pct_change \
278-
pandas.core.groupby.DataFrameGroupBy.prod \
279-
pandas.core.groupby.DataFrameGroupBy.sem \
280-
pandas.core.groupby.DataFrameGroupBy.shift \
281-
pandas.core.groupby.DataFrameGroupBy.size \
282-
pandas.core.groupby.DataFrameGroupBy.skew \
283-
pandas.core.groupby.DataFrameGroupBy.std \
284-
pandas.core.groupby.DataFrameGroupBy.sum \
285-
pandas.core.groupby.DataFrameGroupBy.var \
286-
pandas.core.groupby.SeriesGroupBy.count \
287-
pandas.core.groupby.SeriesGroupBy.cummax \
288-
pandas.core.groupby.SeriesGroupBy.cummin \
289-
pandas.core.groupby.SeriesGroupBy.cumprod \
290-
pandas.core.groupby.SeriesGroupBy.cumsum \
291-
pandas.core.groupby.SeriesGroupBy.diff \
292-
pandas.core.groupby.SeriesGroupBy.ffill \
293-
pandas.core.groupby.SeriesGroupBy.max \
294-
pandas.core.groupby.SeriesGroupBy.median \
295-
pandas.core.groupby.SeriesGroupBy.min \
296-
pandas.core.groupby.SeriesGroupBy.nunique \
297-
pandas.core.groupby.SeriesGroupBy.ohlc \
298-
pandas.core.groupby.SeriesGroupBy.pct_change \
299-
pandas.core.groupby.SeriesGroupBy.prod \
300-
pandas.core.groupby.SeriesGroupBy.sem \
301-
pandas.core.groupby.SeriesGroupBy.shift \
302-
pandas.core.groupby.SeriesGroupBy.size \
303-
pandas.core.groupby.SeriesGroupBy.skew \
304-
pandas.core.groupby.SeriesGroupBy.std \
305-
pandas.core.groupby.SeriesGroupBy.sum \
306-
pandas.core.groupby.SeriesGroupBy.var \
307-
pandas.core.groupby.SeriesGroupBy.hist \
308-
pandas.core.groupby.DataFrameGroupBy.plot \
309-
pandas.core.groupby.SeriesGroupBy.plot \
266+
pandas.core.groupby.SeriesGroupBy.fillna \
310267
pandas.io.formats.style.Styler \
311268
pandas.io.formats.style.Styler.from_custom_template \
312269
pandas.io.formats.style.Styler.set_caption \

ci/upload_wheels.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set_upload_vars() {
1010
export ANACONDA_UPLOAD="true"
1111
elif [[ "$IS_SCHEDULE_DISPATCH" == "true" ]]; then
1212
echo scheduled or dispatched event
13-
export ANACONDA_ORG="scipy-wheels-nightly"
13+
export ANACONDA_ORG="scientific-python-nightly-wheels"
1414
export TOKEN="$PANDAS_NIGHTLY_UPLOAD_TOKEN"
1515
export ANACONDA_UPLOAD="true"
1616
else
@@ -28,12 +28,12 @@ upload_wheels() {
2828
if compgen -G "./dist/*.gz"; then
2929
echo "Found sdist"
3030
anaconda -q -t ${TOKEN} upload --skip -u ${ANACONDA_ORG} ./dist/*.gz
31-
elif compgen -G "./wheelhouse/*.whl"; then
31+
echo "Uploaded sdist"
32+
fi
33+
if compgen -G "./wheelhouse/*.whl"; then
3234
echo "Found wheel"
3335
anaconda -q -t ${TOKEN} upload --skip -u ${ANACONDA_ORG} ./wheelhouse/*.whl
34-
else
35-
echo "Files do not exist"
36-
return 1
36+
echo "Uploaded wheel"
3737
fi
3838
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
3939
fi

doc/source/getting_started/comparison/includes/missing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Forward fill from previous rows
1919

2020
.. ipython:: python
2121
22-
outer_join.fillna(method="ffill")
22+
outer_join.ffill()
2323
2424
Replace missing values with a specified value
2525
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/getting_started/install.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ Installing a nightly build is the quickest way to:
201201
* Try a new feature that will be shipped in the next release (that is, a feature from a pull-request that was recently merged to the main branch).
202202
* Check whether a bug you encountered has been fixed since the last release.
203203

204-
You can install the nightly build of pandas using the scipy-wheels-nightly index from the PyPI registry of anaconda.org with the following command::
204+
You can install the nightly build of pandas using the scientific-python-nightly-wheels index from the PyPI registry of anaconda.org with the following command::
205205

206-
pip install --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple pandas
206+
pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pandas
207207

208208
Note that first uninstalling pandas might be required to be able to install nightly builds::
209209

doc/source/getting_started/intro_tutorials/02_read_write.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ strings (``object``).
9999
.. note::
100100
When asking for the ``dtypes``, no brackets are used!
101101
``dtypes`` is an attribute of a ``DataFrame`` and ``Series``. Attributes
102-
of ``DataFrame`` or ``Series`` do not need brackets. Attributes
103-
represent a characteristic of a ``DataFrame``/``Series``, whereas a
104-
method (which requires brackets) *do* something with the
102+
of a ``DataFrame`` or ``Series`` do not need brackets. Attributes
103+
represent a characteristic of a ``DataFrame``/``Series``, whereas
104+
methods (which require brackets) *do* something with the
105105
``DataFrame``/``Series`` as introduced in the :ref:`first tutorial <10min_tut_01_tableoriented>`.
106106

107107
.. raw:: html

doc/source/user_guide/basics.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1377,12 +1377,12 @@ These methods require that the indexes are **ordered** increasing or
13771377
decreasing.
13781378

13791379
Note that the same result could have been achieved using
1380-
:ref:`fillna <missing_data.fillna>` (except for ``method='nearest'``) or
1380+
:ref:`ffill <missing_data.fillna>` (except for ``method='nearest'``) or
13811381
:ref:`interpolate <missing_data.interpolate>`:
13821382

13831383
.. ipython:: python
13841384
1385-
ts2.reindex(ts.index).fillna(method="ffill")
1385+
ts2.reindex(ts.index).ffill()
13861386
13871387
:meth:`~Series.reindex` will raise a ValueError if the index is not monotonically
13881388
increasing or decreasing. :meth:`~Series.fillna` and :meth:`~Series.interpolate`

doc/source/user_guide/missing_data.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ objects.
145145
:suppress:
146146
147147
df = df2.loc[:, ["one", "two", "three"]]
148-
a = df2.loc[df2.index[:5], ["one", "two"]].fillna(method="pad")
148+
a = df2.loc[df2.index[:5], ["one", "two"]].ffill()
149149
b = df2.loc[df2.index[:5], ["one", "two", "three"]]
150150
151151
.. ipython:: python
@@ -237,7 +237,7 @@ can propagate non-NA values forward or backward:
237237
.. ipython:: python
238238
239239
df
240-
df.fillna(method="pad")
240+
df.ffill()
241241
242242
.. _missing_data.fillna.limit:
243243

@@ -254,7 +254,7 @@ we can use the ``limit`` keyword:
254254
.. ipython:: python
255255
256256
df
257-
df.fillna(method="pad", limit=1)
257+
df.ffill(limit=1)
258258
259259
To remind you, these are the available filling methods:
260260

doc/source/user_guide/style.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
"\n",
6060
"### Formatting Values\n",
6161
"\n",
62-
"The [Styler][styler] distinguishes the *display* value from the *actual* value, in both data values and index or columns headers. To control the display value, the text is printed in each cell as string, and we can use the [.format()][formatfunc] and [.format_index()][formatfuncindex] methods to manipulate this according to a [format spec string][format] or a callable that takes a single value and returns a string. It is possible to define this for the whole table, or index, or for individual columns, or MultiIndex levels. We can also overwrite index names\n",
62+
"The [Styler][styler] distinguishes the *display* value from the *actual* value, in both data values and index or columns headers. To control the display value, the text is printed in each cell as a string, and we can use the [.format()][formatfunc] and [.format_index()][formatfuncindex] methods to manipulate this according to a [format spec string][format] or a callable that takes a single value and returns a string. It is possible to define this for the whole table, or index, or for individual columns, or MultiIndex levels. We can also overwrite index names.\n",
6363
"\n",
64-
"Additionally, the format function has a **precision** argument to specifically help formatting floats, as well as **decimal** and **thousands** separators to support other locales, an **na_rep** argument to display missing data, and an **escape** and **hyperlinks** arguments to help displaying safe-HTML or safe-LaTeX. The default formatter is configured to adopt pandas' global options such as `styler.format.precision` option, controllable using `with pd.option_context('format.precision', 2):` \n",
64+
"Additionally, the format function has a **precision** argument to specifically help format floats, as well as **decimal** and **thousands** separators to support other locales, an **na_rep** argument to display missing data, and an **escape** and **hyperlinks** arguments to help displaying safe-HTML or safe-LaTeX. The default formatter is configured to adopt pandas' global options such as `styler.format.precision` option, controllable using `with pd.option_context('format.precision', 2):`\n",
6565
"\n",
6666
"[styler]: ../reference/api/pandas.io.formats.style.Styler.rst\n",
6767
"[format]: https://docs.python.org/3/library/string.html#format-specification-mini-language\n",

doc/source/user_guide/timeseries.rst

+26-1
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,31 @@ frequencies. We will refer to these aliases as *offset aliases*.
12991299
given frequency it will roll to the next value for ``start_date``
13001300
(respectively previous for the ``end_date``)
13011301

1302+
.. _timeseries.period_aliases:
1303+
1304+
Period aliases
1305+
~~~~~~~~~~~~~~
1306+
1307+
A number of string aliases are given to useful common time series
1308+
frequencies. We will refer to these aliases as *period aliases*.
1309+
1310+
.. csv-table::
1311+
:header: "Alias", "Description"
1312+
:widths: 15, 100
1313+
1314+
"B", "business day frequency"
1315+
"D", "calendar day frequency"
1316+
"W", "weekly frequency"
1317+
"M", "monthly frequency"
1318+
"Q", "quarterly frequency"
1319+
"A, Y", "yearly frequency"
1320+
"H", "hourly frequency"
1321+
"T, min", "minutely frequency"
1322+
"S", "secondly frequency"
1323+
"L, ms", "milliseconds"
1324+
"U, us", "microseconds"
1325+
"N", "nanoseconds"
1326+
13021327

13031328
Combining aliases
13041329
~~~~~~~~~~~~~~~~~
@@ -2083,7 +2108,7 @@ Period dtypes
20832108
dtype similar to the :ref:`timezone aware dtype <timeseries.timezone_series>` (``datetime64[ns, tz]``).
20842109

20852110
The ``period`` dtype holds the ``freq`` attribute and is represented with
2086-
``period[freq]`` like ``period[D]`` or ``period[M]``, using :ref:`frequency strings <timeseries.offset_aliases>`.
2111+
``period[freq]`` like ``period[D]`` or ``period[M]``, using :ref:`frequency strings <timeseries.period_aliases>`.
20872112

20882113
.. ipython:: python
20892114

doc/source/whatsnew/v0.10.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ labeled the aggregated group with the end of the interval: the next day).
226226
valid code. You must either specify a fill value or an interpolation method:
227227

228228
.. ipython:: python
229+
:okwarning:
229230
230231
s = pd.Series([np.nan, 1.0, 2.0, np.nan, 4])
231232
s

doc/source/whatsnew/v2.1.0.rst

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ including other versions of pandas.
1414
Enhancements
1515
~~~~~~~~~~~~
1616

17-
.. _whatsnew_210.enhancements.enhancement1:
17+
.. _whatsnew_210.enhancements.cow:
1818

19-
enhancement1
20-
^^^^^^^^^^^^
19+
Copy-on-Write improvements
20+
^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
22+
- Setting a :class:`Series` into a :class:`DataFrame` now creates a lazy instead of a deep copy (:issue:`53142`)
2123

2224
.. _whatsnew_210.enhancements.enhancement2:
2325

@@ -99,6 +101,7 @@ Other enhancements
99101
- :meth:`Categorical.from_codes` has gotten a ``validate`` parameter (:issue:`50975`)
100102
- :meth:`DataFrame.stack` gained the ``sort`` keyword to dictate whether the resulting :class:`MultiIndex` levels are sorted (:issue:`15105`)
101103
- :meth:`DataFrame.unstack` gained the ``sort`` keyword to dictate whether the resulting :class:`MultiIndex` levels are sorted (:issue:`15105`)
104+
- :meth:`DataFrameGroupby.agg` and :meth:`DataFrameGroupby.transform` now support grouping by multiple keys when the index is not a :class:`MultiIndex` for ``engine="numba"`` (:issue:`53486`)
102105
- :meth:`SeriesGroupby.agg` and :meth:`DataFrameGroupby.agg` now support passing in multiple functions for ``engine="numba"`` (:issue:`53486`)
103106
- Added ``engine_kwargs`` parameter to :meth:`DataFrame.to_excel` (:issue:`53220`)
104107
- Added a new parameter ``by_row`` to :meth:`Series.apply`. When set to ``False`` the supplied callables will always operate on the whole Series (:issue:`53400`).
@@ -224,6 +227,7 @@ Other API changes
224227
Deprecations
225228
~~~~~~~~~~~~
226229
- Deprecated 'broadcast_axis' keyword in :meth:`Series.align` and :meth:`DataFrame.align`, upcast before calling ``align`` with ``left = DataFrame({col: left for col in right.columns}, index=right.index)`` (:issue:`51856`)
230+
- Deprecated 'fill_method' and 'limit' keywords in :meth:`DataFrame.pct_change`, :meth:`Series.pct_change`, :meth:`DataFrameGroupBy.pct_change`, and :meth:`SeriesGroupBy.pct_change`, explicitly call ``ffill`` or ``bfill`` before calling ``pct_change`` instead (:issue:`53491`)
227231
- Deprecated 'method', 'limit', and 'fill_axis' keywords in :meth:`DataFrame.align` and :meth:`Series.align`, explicitly call ``fillna`` on the alignment results instead (:issue:`51856`)
228232
- Deprecated 'quantile' keyword in :meth:`Rolling.quantile` and :meth:`Expanding.quantile`, renamed as 'q' instead (:issue:`52550`)
229233
- Deprecated :meth:`.DataFrameGroupBy.apply` and methods on the objects returned by :meth:`.DataFrameGroupBy.resample` operating on the grouping column(s); select the columns to operate on after groupby to either explicitly include or exclude the groupings and avoid the ``FutureWarning`` (:issue:`7155`)
@@ -280,6 +284,7 @@ Deprecations
280284
- Deprecated option "mode.use_inf_as_na", convert inf entries to ``NaN`` before instead (:issue:`51684`)
281285
- Deprecated positional indexing on :class:`Series` with :meth:`Series.__getitem__` and :meth:`Series.__setitem__`, in a future version ``ser[item]`` will *always* interpret ``item`` as a label, not a position (:issue:`50617`)
282286
- Deprecated strings ``T``, ``t``, ``L`` and ``l`` denoting units in :func:`to_timedelta` (:issue:`52536`)
287+
- Deprecated the "method" and "limit" keywords on :meth:`Series.fillna`, :meth:`DataFrame.fillna`, :meth:`SeriesGroupBy.fillna`, :meth:`DataFrameGroupBy.fillna`, and :meth:`Resampler.fillna`, use ``obj.bfill()`` or ``obj.ffill()`` instead (:issue:`53394`)
283288

284289
.. ---------------------------------------------------------------------------
285290
.. _whatsnew_210.performance:

pandas/_testing/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
from pandas._testing.contexts import (
9898
decompress_file,
9999
ensure_clean,
100-
ensure_safe_environment_variables,
101100
raises_chained_assignment_error,
102101
set_timezone,
103102
use_numexpr,
@@ -1104,7 +1103,6 @@ def shares_memory(left, right) -> bool:
11041103
"EMPTY_STRING_PATTERN",
11051104
"ENDIAN",
11061105
"ensure_clean",
1107-
"ensure_safe_environment_variables",
11081106
"equalContents",
11091107
"external_error_raised",
11101108
"FLOAT_EA_DTYPES",

pandas/_testing/contexts.py

-16
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,6 @@ def ensure_clean(
138138
path.unlink()
139139

140140

141-
@contextmanager
142-
def ensure_safe_environment_variables() -> Generator[None, None, None]:
143-
"""
144-
Get a context manager to safely set environment variables
145-
146-
All changes will be undone on close, hence environment variables set
147-
within this contextmanager will neither persist nor change global state.
148-
"""
149-
saved_environ = dict(os.environ)
150-
try:
151-
yield
152-
finally:
153-
os.environ.clear()
154-
os.environ.update(saved_environ)
155-
156-
157141
@contextmanager
158142
def with_csv_dialect(name: str, **kwargs) -> Generator[None, None, None]:
159143
"""

pandas/conftest.py

+12
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,18 @@ def pytest_collection_modifyitems(items, config) -> None:
150150
"first is deprecated and will be removed in a future version. "
151151
"Please create a mask and filter using `.loc` instead",
152152
),
153+
(
154+
"Resampler.fillna",
155+
"DatetimeIndexResampler.fillna is deprecated",
156+
),
157+
(
158+
"DataFrameGroupBy.fillna",
159+
"DataFrameGroupBy.fillna with 'method' is deprecated",
160+
),
161+
(
162+
"DataFrameGroupBy.fillna",
163+
"DataFrame.fillna with 'method' is deprecated",
164+
),
153165
]
154166

155167
for item in items:

pandas/core/arrays/datetimes.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1145,13 +1145,13 @@ def to_period(self, freq=None) -> PeriodArray:
11451145
11461146
Parameters
11471147
----------
1148-
freq : str or Offset, optional
1149-
One of pandas' :ref:`offset strings <timeseries.offset_aliases>`
1150-
or an Offset object. Will be inferred by default.
1148+
freq : str or Period, optional
1149+
One of pandas' :ref:`period aliases <timeseries.period_aliases>`
1150+
or an Period object. Will be inferred by default.
11511151
11521152
Returns
11531153
-------
1154-
PeriodArray/Index
1154+
PeriodArray/PeriodIndex
11551155
11561156
Raises
11571157
------

0 commit comments

Comments
 (0)