Skip to content

Commit 508abbf

Browse files
DOC: resolve merge conflicts
2 parents 7f3578a + 51c547b commit 508abbf

File tree

6 files changed

+262
-16
lines changed

6 files changed

+262
-16
lines changed

ci/code_checks.sh

+2-11
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7878
-i "pandas.DataFrame.std PR01,RT03,SA01" \
7979
-i "pandas.DataFrame.sum RT03" \
8080
-i "pandas.DataFrame.swaplevel SA01" \
81-
-i "pandas.DataFrame.var PR01,RT03,SA01" \
8281
-i "pandas.Grouper PR02" \
8382
-i "pandas.Index PR07" \
8483
-i "pandas.Index.join PR07,RT03,SA01" \
85-
-i "pandas.Index.names GL08" \
8684
-i "pandas.Index.ravel PR01,RT03" \
8785
-i "pandas.Index.str PR01,SA01" \
8886
-i "pandas.Interval PR02" \
89-
-i "pandas.Interval.closed SA01" \
90-
-i "pandas.Interval.left SA01" \
91-
-i "pandas.Interval.mid SA01" \
92-
-i "pandas.Interval.right SA01" \
9387
-i "pandas.IntervalIndex.closed SA01" \
9488
-i "pandas.IntervalIndex.contains RT03" \
9589
-i "pandas.IntervalIndex.get_loc PR07,RT03,SA01" \
@@ -206,9 +200,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
206200
-i "pandas.Series.list.flatten SA01" \
207201
-i "pandas.Series.list.len SA01" \
208202
-i "pandas.Series.lt PR07,SA01" \
209-
-i "pandas.Series.max RT03" \
210203
-i "pandas.Series.mean RT03,SA01" \
211-
-i "pandas.Series.median RT03,SA01" \
212204
-i "pandas.Series.min RT03" \
213205
-i "pandas.Series.mod PR07" \
214206
-i "pandas.Series.mode SA01" \
@@ -302,7 +294,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
302294
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
303295
-i "pandas.TimedeltaIndex.seconds SA01" \
304296
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
305-
-i "pandas.Timestamp PR07,SA01" \
306297
-i "pandas.Timestamp.as_unit SA01" \
307298
-i "pandas.Timestamp.asm8 SA01" \
308299
-i "pandas.Timestamp.astimezone SA01" \
@@ -321,9 +312,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
321312
-i "pandas.Timestamp.isocalendar SA01" \
322313
-i "pandas.Timestamp.isoformat SA01" \
323314
-i "pandas.Timestamp.isoweekday SA01" \
324-
-i "pandas.Timestamp.max PR02,PR07,SA01" \
315+
-i "pandas.Timestamp.max PR02" \
325316
-i "pandas.Timestamp.microsecond GL08" \
326-
-i "pandas.Timestamp.min PR02,PR07,SA01" \
317+
-i "pandas.Timestamp.min PR02" \
327318
-i "pandas.Timestamp.minute GL08" \
328319
-i "pandas.Timestamp.month GL08" \
329320
-i "pandas.Timestamp.month_name SA01" \

pandas/_libs/interval.pyx

+25
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ cdef class IntervalMixin:
167167
"""
168168
Return the midpoint of the Interval.
169169
170+
See Also
171+
--------
172+
Interval.left : Return the left bound for the interval.
173+
Interval.right : Return the right bound for the interval.
174+
Interval.length : Return the length of the interval.
175+
170176
Examples
171177
--------
172178
>>> iv = pd.Interval(0, 5)
@@ -377,6 +383,12 @@ cdef class Interval(IntervalMixin):
377383
"""
378384
Left bound for the interval.
379385
386+
See Also
387+
--------
388+
Interval.right : Return the right bound for the interval.
389+
numpy.ndarray.left : A similar method in numpy for obtaining
390+
the left endpoint(s) of intervals.
391+
380392
Examples
381393
--------
382394
>>> interval = pd.Interval(left=1, right=2, closed='left')
@@ -390,6 +402,12 @@ cdef class Interval(IntervalMixin):
390402
"""
391403
Right bound for the interval.
392404
405+
See Also
406+
--------
407+
Interval.left : Return the left bound for the interval.
408+
numpy.ndarray.right : A similar method in numpy for obtaining
409+
the right endpoint(s) of intervals.
410+
393411
Examples
394412
--------
395413
>>> interval = pd.Interval(left=1, right=2, closed='left')
@@ -405,6 +423,13 @@ cdef class Interval(IntervalMixin):
405423
406424
Either ``left``, ``right``, ``both`` or ``neither``.
407425
426+
See Also
427+
--------
428+
Interval.closed_left : Check if the interval is closed on the left side.
429+
Interval.closed_right : Check if the interval is closed on the right side.
430+
Interval.open_left : Check if the interval is open on the left side.
431+
Interval.open_right : Check if the interval is open on the right side.
432+
408433
Examples
409434
--------
410435
>>> interval = pd.Interval(left=1, right=2, closed='left')

pandas/_libs/tslibs/timestamps.pyx

+21-2
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,24 @@ class Timestamp(_Timestamp):
12971297
----------
12981298
ts_input : datetime-like, str, int, float
12991299
Value to be converted to Timestamp.
1300-
year, month, day : int
1301-
hour, minute, second, microsecond : int, optional, default 0
1300+
year : int
1301+
Value of year.
1302+
month : int
1303+
Value of month.
1304+
day : int
1305+
Value of day.
1306+
hour : int, optional, default 0
1307+
Value of hour.
1308+
minute : int, optional, default 0
1309+
Value of minute.
1310+
second : int, optional, default 0
1311+
Value of second.
1312+
microsecond : int, optional, default 0
1313+
Value of microsecond.
13021314
tzinfo : datetime.tzinfo, optional, default None
1315+
Timezone info.
13031316
nanosecond : int, optional, default 0
1317+
Value of nanosecond.
13041318
tz : str, pytz.timezone, dateutil.tz.tzfile or None
13051319
Time zone for time which Timestamp will have.
13061320
unit : str
@@ -1316,6 +1330,11 @@ class Timestamp(_Timestamp):
13161330
datetime-like corresponds to the first (0) or the second time (1)
13171331
the wall clock hits the ambiguous time.
13181332
1333+
See Also
1334+
--------
1335+
Timedelta : Represents a duration, the difference between two dates or times.
1336+
datetime.datetime : Python datetime.datetime object.
1337+
13191338
Notes
13201339
-----
13211340
There are essentially three calling conventions for the constructor. The

pandas/core/frame.py

+69-1
Original file line numberDiff line numberDiff line change
@@ -12100,7 +12100,6 @@ def var(
1210012100
) -> Series | Any: ...
1210112101

1210212102
@deprecate_nonkeyword_arguments(version="3.0", allowed_args=["self"], name="var")
12103-
@doc(make_doc("var", ndim=2))
1210412103
def var(
1210512104
self,
1210612105
axis: Axis | None = 0,
@@ -12109,6 +12108,75 @@ def var(
1210912108
numeric_only: bool = False,
1211012109
**kwargs,
1211112110
) -> Series | Any:
12111+
"""
12112+
Return unbiased variance over requested axis.
12113+
12114+
Normalized by N-1 by default. This can be changed using the ddof argument.
12115+
12116+
Parameters
12117+
----------
12118+
axis : {index (0), columns (1)}
12119+
For `Series` this parameter is unused and defaults to 0.
12120+
12121+
.. warning::
12122+
12123+
The behavior of DataFrame.var with ``axis=None`` is deprecated,
12124+
in a future version this will reduce over both axes and return a scalar
12125+
To retain the old behavior, pass axis=0 (or do not pass axis).
12126+
12127+
skipna : bool, default True
12128+
Exclude NA/null values. If an entire row/column is NA, the result
12129+
will be NA.
12130+
ddof : int, default 1
12131+
Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
12132+
where N represents the number of elements.
12133+
numeric_only : bool, default False
12134+
Include only float, int, boolean columns. Not implemented for Series.
12135+
**kwargs :
12136+
Additional keywords passed.
12137+
12138+
Returns
12139+
-------
12140+
Series or scalaer
12141+
Unbiased variance over requested axis.
12142+
12143+
See Also
12144+
--------
12145+
numpy.var : Equivalent function in NumPy.
12146+
Series.var : Return unbiased variance over Series values.
12147+
Series.std : Return standard deviation over Series values.
12148+
DataFrame.std : Return standard deviation of the values over
12149+
the requested axis.
12150+
12151+
Examples
12152+
--------
12153+
>>> df = pd.DataFrame(
12154+
... {
12155+
... "person_id": [0, 1, 2, 3],
12156+
... "age": [21, 25, 62, 43],
12157+
... "height": [1.61, 1.87, 1.49, 2.01],
12158+
... }
12159+
... ).set_index("person_id")
12160+
>>> df
12161+
age height
12162+
person_id
12163+
0 21 1.61
12164+
1 25 1.87
12165+
2 62 1.49
12166+
3 43 2.01
12167+
12168+
>>> df.var()
12169+
age 352.916667
12170+
height 0.056367
12171+
dtype: float64
12172+
12173+
Alternatively, ``ddof=0`` can be set to normalize by N instead of N-1:
12174+
12175+
>>> df.var(ddof=0)
12176+
age 264.687500
12177+
height 0.042275
12178+
dtype: float64
12179+
"""
1211212180
result = super().var(
1211312181
axis=axis, skipna=skipna, ddof=ddof, numeric_only=numeric_only, **kwargs
1211412182
)

pandas/core/indexes/base.py

+17
Original file line numberDiff line numberDiff line change
@@ -1799,6 +1799,23 @@ def _get_default_index_names(
17991799
return names
18001800

18011801
def _get_names(self) -> FrozenList:
1802+
"""
1803+
Get names on index.
1804+
1805+
See Also
1806+
--------
1807+
Index.name : Return Index or MultiIndex name.
1808+
1809+
Examples
1810+
--------
1811+
>>> idx = pd.Index([1, 2, 3], name="x")
1812+
>>> idx.names
1813+
FrozenList(['x'])
1814+
1815+
>>> idx = s = pd.Index([1, 2, 3], name=("x", "y"))
1816+
>>> idx.names
1817+
FrozenList([('x', 'y')])
1818+
"""
18021819
return FrozenList((self.name,))
18031820

18041821
def _set_names(self, values, *, level=None) -> None:

0 commit comments

Comments
 (0)