Skip to content

Commit b6eee42

Browse files
committed
Resolve merge conflict in whatsnew/v3.0.0.rst
2 parents 3c5f985 + 888b6bc commit b6eee42

File tree

33 files changed

+16390
-153
lines changed

33 files changed

+16390
-153
lines changed

asv_bench/benchmarks/frame_methods.py

+24
Original file line numberDiff line numberDiff line change
@@ -862,4 +862,28 @@ def time_last_valid_index(self, dtype):
862862
self.df.last_valid_index()
863863

864864

865+
class Update:
866+
def setup(self):
867+
rng = np.random.default_rng()
868+
self.df = DataFrame(rng.uniform(size=(1_000_000, 10)))
869+
870+
idx = rng.choice(range(1_000_000), size=1_000_000, replace=False)
871+
self.df_random = DataFrame(self.df, index=idx)
872+
873+
idx = rng.choice(range(1_000_000), size=100_000, replace=False)
874+
cols = rng.choice(range(10), size=2, replace=False)
875+
self.df_sample = DataFrame(
876+
rng.uniform(size=(100_000, 2)), index=idx, columns=cols
877+
)
878+
879+
def time_to_update_big_frame_small_arg(self):
880+
self.df.update(self.df_sample)
881+
882+
def time_to_update_random_indices(self):
883+
self.df_random.update(self.df_sample)
884+
885+
def time_to_update_small_frame_big_arg(self):
886+
self.df_sample.update(self.df)
887+
888+
865889
from .pandas_vb_common import setup # noqa: F401 isort:skip

ci/code_checks.sh

-5
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
153153
-i "pandas.DatetimeTZDtype SA01" \
154154
-i "pandas.DatetimeTZDtype.tz SA01" \
155155
-i "pandas.DatetimeTZDtype.unit SA01" \
156-
-i "pandas.ExcelFile PR01,SA01" \
157-
-i "pandas.ExcelFile.parse PR01,SA01" \
158-
-i "pandas.ExcelWriter SA01" \
159-
-i "pandas.Float32Dtype SA01" \
160-
-i "pandas.Float64Dtype SA01" \
161156
-i "pandas.Grouper PR02,SA01" \
162157
-i "pandas.HDFStore.append PR01,SA01" \
163158
-i "pandas.HDFStore.get SA01" \

doc/source/getting_started/install.rst

+2
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ SciPy 1.10.0 computation Miscellaneous stati
269269
xarray 2022.12.0 computation pandas-like API for N-dimensional data
270270
========================= ================== =============== =============================================================
271271

272+
.. _install.excel_dependencies:
273+
272274
Excel files
273275
^^^^^^^^^^^
274276

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

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ strings (``object``).
111111

112112
My colleague requested the Titanic data as a spreadsheet.
113113

114+
.. note::
115+
If you want to use :func:`~pandas.to_excel` and :func:`~pandas.read_excel`,
116+
you need to install an Excel reader as outlined in the
117+
:ref:`Excel files <install.excel_dependencies>` section of the
118+
installation documentation.
119+
114120
.. ipython:: python
115121
116122
titanic.to_excel("titanic.xlsx", sheet_name="passengers", index=False)

doc/source/user_guide/missing_data.rst

+21
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,27 @@ Replace NA with a scalar value
386386
df
387387
df.fillna(0)
388388
389+
When the data has object dtype, you can control what type of NA values are present.
390+
391+
.. ipython:: python
392+
393+
df = pd.DataFrame({"a": [pd.NA, np.nan, None]}, dtype=object)
394+
df
395+
df.fillna(None)
396+
df.fillna(np.nan)
397+
df.fillna(pd.NA)
398+
399+
However when the dtype is not object, these will all be replaced with the proper NA value for the dtype.
400+
401+
.. ipython:: python
402+
403+
data = {"np": [1.0, np.nan, np.nan, 2], "arrow": pd.array([1.0, pd.NA, pd.NA, 2], dtype="float64[pyarrow]")}
404+
df = pd.DataFrame(data)
405+
df
406+
df.fillna(None)
407+
df.fillna(np.nan)
408+
df.fillna(pd.NA)
409+
389410
Fill gaps forward or backward
390411

391412
.. ipython:: python

0 commit comments

Comments
 (0)