Skip to content

Commit 8b93cad

Browse files
authored
Merge branch 'main' into to_timestamp
2 parents 1af3906 + 02267e5 commit 8b93cad

File tree

6 files changed

+43
-7
lines changed

6 files changed

+43
-7
lines changed

.github/workflows/package-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
fetch-depth: 0
6868

6969
- name: Set up Python
70-
uses: mamba-org/setup-micromamba@v1
70+
uses: mamba-org/setup-micromamba@v2
7171
with:
7272
environment-name: recipe-test
7373
create-args: >-

.github/workflows/wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}
166166

167167
- name: Set up Python
168-
uses: mamba-org/setup-micromamba@v1
168+
uses: mamba-org/setup-micromamba@v2
169169
with:
170170
environment-name: wheel-env
171171
# Use a fixed Python, since we might have an unreleased Python not

ci/code_checks.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
154154
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
155155
-i "pandas.infer_freq SA01" \
156156
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
157-
-i "pandas.io.stata.StataReader.value_labels RT03,SA01" \
158157
-i "pandas.io.stata.StataReader.variable_labels RT03,SA01" \
159158
-i "pandas.io.stata.StataWriter.write_file SA01" \
160159
-i "pandas.json_normalize RT03,SA01" \
161160
-i "pandas.plotting.andrews_curves RT03,SA01" \
162-
-i "pandas.plotting.lag_plot RT03,SA01" \
163161
-i "pandas.plotting.scatter_matrix PR07,SA01" \
164162
-i "pandas.set_eng_float_format RT03,SA01" \
165163
-i "pandas.tseries.offsets.BDay PR02,SA01" \

pandas/_libs/tslibs/nattype.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from typing import (
99
Literal,
1010
NoReturn,
1111
TypeAlias,
12+
overload,
1213
)
1314

1415
import numpy as np
@@ -159,15 +160,31 @@ class NaTType:
159160
# inject Period properties
160161
@property
161162
def qyear(self) -> float: ...
163+
# comparisons
162164
def __eq__(self, other: object) -> bool: ...
163165
def __ne__(self, other: object) -> bool: ...
164166
__lt__: _NatComparison
165167
__le__: _NatComparison
166168
__gt__: _NatComparison
167169
__ge__: _NatComparison
170+
# unary operators
171+
def __pos__(self) -> Self: ...
172+
def __neg__(self) -> Self: ...
173+
# binary operators
168174
def __sub__(self, other: Self | timedelta | datetime) -> Self: ...
169175
def __rsub__(self, other: Self | timedelta | datetime) -> Self: ...
170176
def __add__(self, other: Self | timedelta | datetime) -> Self: ...
171177
def __radd__(self, other: Self | timedelta | datetime) -> Self: ...
178+
def __mul__(self, other: float) -> Self: ... # analogous to timedelta
179+
def __rmul__(self, other: float) -> Self: ...
180+
@overload # analogous to timedelta
181+
def __truediv__(self, other: Self | timedelta) -> float: ... # Literal[NaN]
182+
@overload
183+
def __truediv__(self, other: float) -> Self: ...
184+
@overload # analogous to timedelta
185+
def __floordiv__(self, other: Self | timedelta) -> float: ... # Literal[NaN]
186+
@overload
187+
def __floordiv__(self, other: float) -> Self: ...
188+
# other
172189
def __hash__(self) -> int: ...
173190
def as_unit(self, unit: str, round_ok: bool = ...) -> NaTType: ...

pandas/io/stata.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,9 +2076,19 @@ def value_labels(self) -> dict[str, dict[int, str]]:
20762076
"""
20772077
Return a nested dict associating each variable name to its value and label.
20782078
2079+
This method retrieves the value labels from a Stata file. Value labels are
2080+
mappings between the coded values and their corresponding descriptive labels
2081+
in a Stata dataset.
2082+
20792083
Returns
20802084
-------
20812085
dict
2086+
A python dictionary.
2087+
2088+
See Also
2089+
--------
2090+
read_stata : Read Stata file into DataFrame.
2091+
DataFrame.to_stata : Export DataFrame object to Stata dta format.
20822092
20832093
Examples
20842094
--------

pandas/plotting/_misc.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def table(ax: Axes, data: DataFrame | Series, **kwargs) -> Table:
3939
**kwargs
4040
Keyword arguments to be passed to matplotlib.table.table.
4141
If `rowLabels` or `colLabels` is not specified, data index or column
42-
name will be used.
42+
names will be used.
4343
4444
Returns
4545
-------
@@ -59,11 +59,11 @@ def table(ax: Axes, data: DataFrame | Series, **kwargs) -> Table:
5959
6060
>>> import matplotlib.pyplot as plt
6161
>>> df = pd.DataFrame({"A": [1, 2], "B": [3, 4]})
62-
>>> fix, ax = plt.subplots()
62+
>>> fig, ax = plt.subplots()
6363
>>> ax.axis("off")
6464
(0.0, 1.0, 0.0, 1.0)
6565
>>> table = pd.plotting.table(
66-
... ax, df, loc="center", cellLoc="center", colWidths=list([0.2, 0.2])
66+
... ax, df, loc="center", cellLoc="center", colWidths=[0.2, 0.2]
6767
... )
6868
"""
6969
plot_backend = _get_plot_backend("matplotlib")
@@ -549,6 +549,10 @@ def lag_plot(series: Series, lag: int = 1, ax: Axes | None = None, **kwds) -> Ax
549549
"""
550550
Lag plot for time series.
551551
552+
A lag plot is a scatter plot of a time series against a lag of itself. It helps
553+
in visualizing the temporal dependence between observations by plotting the values
554+
at time `t` on the x-axis and the values at time `t + lag` on the y-axis.
555+
552556
Parameters
553557
----------
554558
series : Series
@@ -563,6 +567,13 @@ def lag_plot(series: Series, lag: int = 1, ax: Axes | None = None, **kwds) -> Ax
563567
Returns
564568
-------
565569
matplotlib.axes.Axes
570+
The matplotlib Axes object containing the lag plot.
571+
572+
See Also
573+
--------
574+
plotting.autocorrelation_plot : Autocorrelation plot for time series.
575+
matplotlib.pyplot.scatter : A scatter plot of y vs. x with varying marker size
576+
and/or color in Matplotlib.
566577
567578
Examples
568579
--------

0 commit comments

Comments
 (0)