Skip to content

Commit 57b2d27

Browse files
authored
Merge branch 'main' into fix-armv7-build
2 parents 39b8a01 + 00855f8 commit 57b2d27

File tree

14 files changed

+582
-221
lines changed

14 files changed

+582
-221
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,18 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9797
-i "pandas.Series.dt.unit GL08" \
9898
-i "pandas.Series.pad PR01,SA01" \
9999
-i "pandas.Series.sparse.from_coo PR07,SA01" \
100-
-i "pandas.Series.sparse.npoints SA01" \
101100
-i "pandas.Timedelta.max PR02" \
102101
-i "pandas.Timedelta.min PR02" \
103102
-i "pandas.Timedelta.resolution PR02" \
104-
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
105103
-i "pandas.Timestamp.max PR02" \
106104
-i "pandas.Timestamp.min PR02" \
107105
-i "pandas.Timestamp.nanosecond GL08" \
108106
-i "pandas.Timestamp.resolution PR02" \
109107
-i "pandas.Timestamp.tzinfo GL08" \
110108
-i "pandas.Timestamp.year GL08" \
111-
-i "pandas.api.types.is_dict_like PR07,SA01" \
112-
-i "pandas.api.types.is_file_like PR07,SA01" \
113109
-i "pandas.api.types.is_float PR01,SA01" \
114-
-i "pandas.api.types.is_hashable PR01,RT03,SA01" \
115110
-i "pandas.api.types.is_integer PR01,SA01" \
116111
-i "pandas.api.types.is_iterator PR07,SA01" \
117-
-i "pandas.api.types.is_named_tuple PR07,SA01" \
118-
-i "pandas.api.types.is_re PR07,SA01" \
119112
-i "pandas.api.types.is_re_compilable PR07,SA01" \
120113
-i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \
121114
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
@@ -128,8 +121,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
128121
-i "pandas.arrays.SparseArray PR07,SA01" \
129122
-i "pandas.arrays.TimedeltaArray PR07,SA01" \
130123
-i "pandas.core.groupby.DataFrameGroupBy.__iter__ RT03,SA01" \
131-
-i "pandas.core.groupby.DataFrameGroupBy.agg RT03" \
132-
-i "pandas.core.groupby.DataFrameGroupBy.aggregate RT03" \
133124
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \
134125
-i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \
135126
-i "pandas.core.groupby.DataFrameGroupBy.groups SA01" \
@@ -140,8 +131,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
140131
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
141132
-i "pandas.core.groupby.DataFrameGroupBy.sem SA01" \
142133
-i "pandas.core.groupby.SeriesGroupBy.__iter__ RT03,SA01" \
143-
-i "pandas.core.groupby.SeriesGroupBy.agg RT03" \
144-
-i "pandas.core.groupby.SeriesGroupBy.aggregate RT03" \
145134
-i "pandas.core.groupby.SeriesGroupBy.get_group RT03,SA01" \
146135
-i "pandas.core.groupby.SeriesGroupBy.groups SA01" \
147136
-i "pandas.core.groupby.SeriesGroupBy.indices SA01" \
@@ -170,7 +159,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
170159
-i "pandas.errors.CSSWarning SA01" \
171160
-i "pandas.errors.CategoricalConversionWarning SA01" \
172161
-i "pandas.errors.ChainedAssignmentError SA01" \
173-
-i "pandas.errors.ClosedFileError SA01" \
174162
-i "pandas.errors.DataError SA01" \
175163
-i "pandas.errors.DuplicateLabelError SA01" \
176164
-i "pandas.errors.IntCastingNaNError SA01" \
@@ -180,7 +168,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
180168
-i "pandas.errors.NumExprClobberingError SA01" \
181169
-i "pandas.errors.NumbaUtilError SA01" \
182170
-i "pandas.errors.OptionError SA01" \
183-
-i "pandas.errors.OutOfBoundsDatetime SA01" \
184171
-i "pandas.errors.OutOfBoundsTimedelta SA01" \
185172
-i "pandas.errors.PerformanceWarning SA01" \
186173
-i "pandas.errors.PossibleDataLossError SA01" \

doc/source/getting_started/intro_tutorials/08_combine_dataframes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Add the parameters' full description and name, provided by the parameters metada
271271
272272
Compared to the previous example, there is no common column name.
273273
However, the ``parameter`` column in the ``air_quality`` table and the
274-
``id`` column in the ``air_quality_parameters_name`` both provide the
274+
``id`` column in the ``air_quality_parameters`` table both provide the
275275
measured variable in a common format. The ``left_on`` and ``right_on``
276276
arguments are used here (instead of just ``on``) to make the link
277277
between the two tables.

doc/source/user_guide/10min.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ See the indexing documentation :ref:`Indexing and Selecting Data <indexing>` and
177177
Getitem (``[]``)
178178
~~~~~~~~~~~~~~~~
179179

180-
For a :class:`DataFrame`, passing a single label selects a columns and
180+
For a :class:`DataFrame`, passing a single label selects a column and
181181
yields a :class:`Series` equivalent to ``df.A``:
182182

183183
.. ipython:: python

pandas/_libs/tslibs/nattype.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ class NaTType(_NaT):
500500
--------
501501
to_timedelta : Convert argument to timedelta.
502502
Timedelta : Represents a duration, the difference between two dates or times.
503+
Timedelta.seconds : Returns the seconds component of the timedelta.
504+
Timedelta.microseconds : Returns the microseconds component of the timedelta.
503505
504506
Examples
505507
--------

pandas/_libs/tslibs/np_datetime.pyx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@ class OutOfBoundsDatetime(ValueError):
176176
"""
177177
Raised when the datetime is outside the range that can be represented.
178178
179+
This error occurs when attempting to convert or parse a datetime value
180+
that exceeds the bounds supported by pandas' internal datetime
181+
representation.
182+
183+
See Also
184+
--------
185+
to_datetime : Convert argument to datetime.
186+
Timestamp : Pandas replacement for python ``datetime.datetime`` object.
187+
179188
Examples
180189
--------
181190
>>> pd.to_datetime("08335394550")

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,8 @@ cdef class _Timedelta(timedelta):
11961196
--------
11971197
to_timedelta : Convert argument to timedelta.
11981198
Timedelta : Represents a duration, the difference between two dates or times.
1199+
Timedelta.seconds : Returns the seconds component of the timedelta.
1200+
Timedelta.microseconds : Returns the microseconds component of the timedelta.
11991201

12001202
Examples
12011203
--------
@@ -1493,6 +1495,7 @@ cdef class _Timedelta(timedelta):
14931495
14941496
See Also
14951497
--------
1498+
Timedelta.asm8 : Return a numpy timedelta64 array scalar view.
14961499
numpy.ndarray.view : Returns a view of an array with the same data.
14971500
Timedelta.to_numpy : Converts the Timedelta to a NumPy timedelta64.
14981501
Timedelta.total_seconds : Returns the total duration of the Timedelta

pandas/core/arrays/sparse/array.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,18 @@ def npoints(self) -> int:
708708
"""
709709
The number of non- ``fill_value`` points.
710710
711+
This property returns the number of elements in the sparse series that are
712+
not equal to the ``fill_value``. Sparse data structures store only the
713+
non-``fill_value`` elements, reducing memory usage when the majority of
714+
values are the same.
715+
716+
See Also
717+
--------
718+
Series.sparse.to_dense : Convert a Series from sparse values to dense.
719+
Series.sparse.fill_value : Elements in ``data`` that are ``fill_value`` are
720+
not stored.
721+
Series.sparse.density : The percent of non- ``fill_value`` points, as decimal.
722+
711723
Examples
712724
--------
713725
>>> from pandas.arrays import SparseArray

pandas/core/arrays/timedeltas.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,19 @@ def to_pytimedelta(self) -> npt.NDArray[np.object_]:
790790
Returns
791791
-------
792792
numpy.ndarray
793+
A NumPy ``timedelta64`` object representing the same duration as the
794+
original pandas ``Timedelta`` object. The precision of the resulting
795+
object is in nanoseconds, which is the default
796+
time resolution used by pandas for ``Timedelta`` objects, ensuring
797+
high precision for time-based calculations.
798+
799+
See Also
800+
--------
801+
to_timedelta : Convert argument to timedelta format.
802+
Timedelta : Represents a duration between two dates or times.
803+
DatetimeIndex: Index of datetime64 data.
804+
Timedelta.components : Return a components namedtuple-like
805+
of a single timedelta.
793806
794807
Examples
795808
--------
@@ -800,6 +813,14 @@ def to_pytimedelta(self) -> npt.NDArray[np.object_]:
800813
>>> tdelta_idx.to_pytimedelta()
801814
array([datetime.timedelta(days=1), datetime.timedelta(days=2),
802815
datetime.timedelta(days=3)], dtype=object)
816+
817+
>>> tidx = pd.TimedeltaIndex(data=["1 days 02:30:45", "3 days 04:15:10"])
818+
>>> tidx
819+
TimedeltaIndex(['1 days 02:30:45', '3 days 04:15:10'],
820+
dtype='timedelta64[ns]', freq=None)
821+
>>> tidx.to_pytimedelta()
822+
array([datetime.timedelta(days=1, seconds=9045),
823+
datetime.timedelta(days=3, seconds=15310)], dtype=object)
803824
"""
804825
return ints_to_pytimedelta(self._ndarray)
805826

pandas/core/dtypes/inference.py

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,24 @@ def is_file_like(obj: object) -> bool:
113113
114114
Parameters
115115
----------
116-
obj : The object to check
116+
obj : object
117+
The object to check for file-like properties.
118+
This can be any Python object, and the function will
119+
check if it has attributes typically associated with
120+
file-like objects (e.g., `read`, `write`, `__iter__`).
117121
118122
Returns
119123
-------
120124
bool
121125
Whether `obj` has file-like properties.
122126
127+
See Also
128+
--------
129+
api.types.is_dict_like : Check if the object is dict-like.
130+
api.types.is_hashable : Return True if hash(obj) will succeed, False otherwise.
131+
api.types.is_named_tuple : Check if the object is a named tuple.
132+
api.types.is_iterator : Check if the object is an iterator.
133+
123134
Examples
124135
--------
125136
>>> import io
@@ -142,13 +153,24 @@ def is_re(obj: object) -> TypeGuard[Pattern]:
142153
143154
Parameters
144155
----------
145-
obj : The object to check
156+
obj : object
157+
The object to check for being a regex pattern. Typically,
158+
this would be an object that you expect to be a compiled
159+
pattern from the `re` module.
146160
147161
Returns
148162
-------
149163
bool
150164
Whether `obj` is a regex pattern.
151165
166+
See Also
167+
--------
168+
api.types.is_float : Return True if given object is float.
169+
api.types.is_iterator : Check if the object is an iterator.
170+
api.types.is_integer : Return True if given object is integer.
171+
api.types.is_re_compilable : Check if the object can be compiled
172+
into a regex pattern instance.
173+
152174
Examples
153175
--------
154176
>>> from pandas.api.types import is_re
@@ -275,13 +297,22 @@ def is_dict_like(obj: object) -> bool:
275297
276298
Parameters
277299
----------
278-
obj : The object to check
300+
obj : object
301+
The object to check. This can be any Python object,
302+
and the function will determine whether it
303+
behaves like a dictionary.
279304
280305
Returns
281306
-------
282307
bool
283308
Whether `obj` has dict-like properties.
284309
310+
See Also
311+
--------
312+
api.types.is_list_like : Check if the object is list-like.
313+
api.types.is_file_like : Check if the object is a file-like.
314+
api.types.is_named_tuple : Check if the object is a named tuple.
315+
285316
Examples
286317
--------
287318
>>> from pandas.api.types import is_dict_like
@@ -308,13 +339,22 @@ def is_named_tuple(obj: object) -> bool:
308339
309340
Parameters
310341
----------
311-
obj : The object to check
342+
obj : object
343+
The object that will be checked to determine
344+
whether it is a named tuple.
312345
313346
Returns
314347
-------
315348
bool
316349
Whether `obj` is a named tuple.
317350
351+
See Also
352+
--------
353+
api.types.is_dict_like: Check if the object is dict-like.
354+
api.types.is_hashable: Return True if hash(obj)
355+
will succeed, False otherwise.
356+
api.types.is_categorical_dtype : Check if the dtype is categorical.
357+
318358
Examples
319359
--------
320360
>>> from collections import namedtuple
@@ -340,9 +380,24 @@ def is_hashable(obj: object) -> TypeGuard[Hashable]:
340380
Distinguish between these and other types by trying the call to hash() and
341381
seeing if they raise TypeError.
342382
383+
Parameters
384+
----------
385+
obj : object
386+
The object to check for hashability. Any Python object can be passed here.
387+
343388
Returns
344389
-------
345390
bool
391+
True if object can be hashed (i.e., does not raise TypeError when
392+
passed to hash()), and False otherwise (e.g., if object is mutable
393+
like a list or dictionary).
394+
395+
See Also
396+
--------
397+
api.types.is_float : Return True if given object is float.
398+
api.types.is_iterator : Check if the object is an iterator.
399+
api.types.is_list_like : Check if the object is list-like.
400+
api.types.is_dict_like : Check if the object is dict-like.
346401
347402
Examples
348403
--------

0 commit comments

Comments
 (0)