Skip to content

Commit 62cc55e

Browse files
authored
Merge branch 'main' into deps/pytz/optional
2 parents c59f52e + 642d244 commit 62cc55e

File tree

210 files changed

+1360
-395
lines changed

Some content is hidden

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

210 files changed

+1360
-395
lines changed

.circleci/config.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
- checkout
1616
- run:
1717
name: Install Environment and Run Tests
18-
shell: /bin/bash -exuo pipefail
18+
shell: /bin/bash -exo pipefail
1919
command: |
20-
MAMBA_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Mambaforge-24.3.0-0-Linux-aarch64.sh"
21-
wget -q $MAMBA_URL -O minimamba.sh
22-
chmod +x minimamba.sh
23-
MAMBA_DIR="$HOME/miniconda3"
24-
rm -rf $MAMBA_DIR
25-
./minimamba.sh -b -p $MAMBA_DIR
26-
export PATH=$MAMBA_DIR/bin:$PATH
20+
MINI_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-24.3.0-0-Linux-aarch64.sh"
21+
wget -q $MINI_URL -O Miniforge3.sh
22+
chmod +x Miniforge3.sh
23+
MINI_DIR="$HOME/miniconda3"
24+
rm -rf $MINI_DIR
25+
./Miniforge3.sh -b -p $MINI_DIR
26+
export PATH=$MINI_DIR/bin:$PATH
2727
conda info -a
2828
conda env create -q -n pandas-dev -f $ENV_FILE
2929
conda list -n pandas-dev
@@ -97,21 +97,16 @@ jobs:
9797

9898
- run:
9999
name: Install Anaconda Client & Upload Wheels
100+
shell: /bin/bash -exo pipefail
100101
command: |
101-
echo "Install Mambaforge"
102-
MAMBA_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Mambaforge-24.3.0-0-Linux-aarch64.sh"
103-
echo "Downloading $MAMBA_URL"
104-
wget -q $MAMBA_URL -O minimamba.sh
105-
chmod +x minimamba.sh
106-
107-
MAMBA_DIR="$HOME/miniconda3"
108-
rm -rf $MAMBA_DIR
109-
./minimamba.sh -b -p $MAMBA_DIR
110-
111-
export PATH=$MAMBA_DIR/bin:$PATH
112-
113-
mamba install -y -c conda-forge anaconda-client
114-
102+
MINI_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-24.3.0-0-Linux-aarch64.sh"
103+
wget -q $MINI_URL -O Miniforge3.sh
104+
chmod +x Miniforge3.sh
105+
MINI_DIR="$HOME/miniconda3"
106+
rm -rf $MINI_DIR
107+
./Miniforge3.sh -b -p $MINI_DIR
108+
export PATH=$MINI_DIR/bin:$PATH
109+
conda install -y -c conda-forge anaconda-client
115110
source ci/upload_wheels.sh
116111
set_upload_vars
117112
upload_wheels

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
extra_loc: "zh_CN"
6060
- name: "Future infer strings"
6161
env_file: actions-311.yaml
62-
pattern: "not slow and not network and not single_cpu"
6362
pandas_future_infer_string: "1"
6463
- name: "Pypy"
6564
env_file: actions-pypy-39.yaml

ci/code_checks.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7070
--format=actions \
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
73-
-i "pandas.MultiIndex.append PR07,SA01" \
74-
-i "pandas.MultiIndex.copy PR07,RT03,SA01" \
7573
-i "pandas.MultiIndex.get_level_values SA01" \
76-
-i "pandas.MultiIndex.get_loc PR07" \
7774
-i "pandas.MultiIndex.get_loc_level PR07" \
78-
-i "pandas.MultiIndex.levshape SA01" \
7975
-i "pandas.MultiIndex.names SA01" \
80-
-i "pandas.MultiIndex.remove_unused_levels RT03,SA01" \
8176
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
82-
-i "pandas.MultiIndex.set_levels RT03,SA01" \
8377
-i "pandas.MultiIndex.sortlevel PR07,SA01" \
8478
-i "pandas.MultiIndex.to_frame RT03" \
8579
-i "pandas.NA SA01" \
@@ -223,7 +217,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
223217
-i "pandas.Timestamp.fromordinal SA01" \
224218
-i "pandas.Timestamp.fromtimestamp PR01,SA01" \
225219
-i "pandas.Timestamp.hour GL08" \
226-
-i "pandas.Timestamp.isoweekday SA01" \
227220
-i "pandas.Timestamp.max PR02" \
228221
-i "pandas.Timestamp.microsecond GL08" \
229222
-i "pandas.Timestamp.min PR02" \
@@ -328,7 +321,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
328321
-i "pandas.core.groupby.DataFrameGroupBy.hist RT03" \
329322
-i "pandas.core.groupby.DataFrameGroupBy.indices SA01" \
330323
-i "pandas.core.groupby.DataFrameGroupBy.max SA01" \
331-
-i "pandas.core.groupby.DataFrameGroupBy.median SA01" \
332324
-i "pandas.core.groupby.DataFrameGroupBy.min SA01" \
333325
-i "pandas.core.groupby.DataFrameGroupBy.nth PR02" \
334326
-i "pandas.core.groupby.DataFrameGroupBy.nunique SA01" \
@@ -347,7 +339,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
347339
-i "pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing SA01" \
348340
-i "pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing SA01" \
349341
-i "pandas.core.groupby.SeriesGroupBy.max SA01" \
350-
-i "pandas.core.groupby.SeriesGroupBy.median SA01" \
351342
-i "pandas.core.groupby.SeriesGroupBy.min SA01" \
352343
-i "pandas.core.groupby.SeriesGroupBy.nth PR02" \
353344
-i "pandas.core.groupby.SeriesGroupBy.ohlc SA01" \
@@ -362,7 +353,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
362353
-i "pandas.core.resample.Resampler.indices SA01" \
363354
-i "pandas.core.resample.Resampler.max PR01,RT03,SA01" \
364355
-i "pandas.core.resample.Resampler.mean SA01" \
365-
-i "pandas.core.resample.Resampler.median SA01" \
366356
-i "pandas.core.resample.Resampler.min PR01,RT03,SA01" \
367357
-i "pandas.core.resample.Resampler.ohlc SA01" \
368358
-i "pandas.core.resample.Resampler.prod SA01" \

ci/run_tests.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,5 @@ if [[ "$PATTERN" ]]; then
1616
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""
1717
fi
1818

19-
# temporarily let pytest always succeed (many tests are not yet passing in the
20-
# build enabling the future string dtype)
21-
if [[ "$PANDAS_FUTURE_INFER_STRING" == "1" ]]; then
22-
PYTEST_CMD="$PYTEST_CMD || true"
23-
fi
24-
2519
echo $PYTEST_CMD
2620
sh -c "$PYTEST_CMD"

doc/source/user_guide/style.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
"\n",
352352
"- Using [.set_table_styles()][table] to control broader areas of the table with specified internal CSS. Although table styles allow the flexibility to add CSS selectors and properties controlling all individual parts of the table, they are unwieldy for individual cell specifications. Also, note that table styles cannot be exported to Excel. \n",
353353
"- Using [.set_td_classes()][td_class] to directly link either external CSS classes to your data cells or link the internal CSS classes created by [.set_table_styles()][table]. See [here](#Setting-Classes-and-Linking-to-External-CSS). These cannot be used on column header rows or indexes, and also won't export to Excel. \n",
354-
"- Using the [.apply()][apply] and [.map()][map] functions to add direct internal CSS to specific data cells. See [here](#Styler-Functions). As of v1.4.0 there are also methods that work directly on column header rows or indexes; [.apply_index()][applyindex] and [.map_index()][mapindex]. Note that only these methods add styles that will export to Excel. These methods work in a similar way to [DataFrame.apply()][dfapply] and [DataFrame.map()][dfmap].\n",
354+
"- Using the [.apply()][apply] and [.map()][map] functions to add direct internal CSS to specific data cells. See [here](#Styler-Functions). As of v1.4.0 there are also methods that work directly on column header rows or indexes: [.apply_index()][applyindex] and [.map_index()][mapindex]. Note that only these methods add styles that will export to Excel. These methods work in a similar way to [DataFrame.apply()][dfapply] and [DataFrame.map()][dfmap].\n",
355355
"\n",
356356
"[table]: ../reference/api/pandas.io.formats.style.Styler.set_table_styles.rst\n",
357357
"[styler]: ../reference/api/pandas.io.formats.style.Styler.rst\n",

doc/source/whatsnew/v3.0.0.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Other enhancements
3535
- :meth:`DataFrame.agg` called with ``axis=1`` and a ``func`` which relabels the result index now raises a ``NotImplementedError`` (:issue:`58807`).
3636
- :meth:`Index.get_loc` now accepts also subclasses of ``tuple`` as keys (:issue:`57922`)
3737
- :meth:`Styler.set_tooltips` provides alternative method to storing tooltips by using title attribute of td elements. (:issue:`56981`)
38+
- Added missing parameter ``weights`` in :meth:`DataFrame.plot.kde` for the estimation of the PDF (:issue:`59337`)
3839
- Allow dictionaries to be passed to :meth:`pandas.Series.str.replace` via ``pat`` parameter (:issue:`51748`)
3940
- Support passing a :class:`Series` input to :func:`json_normalize` that retains the :class:`Series` :class:`Index` (:issue:`51452`)
4041
- Support reading value labels from Stata 108-format (Stata 6) and earlier files (:issue:`58154`)
@@ -617,10 +618,11 @@ I/O
617618
- Bug in :meth:`read_json` not validating the ``typ`` argument to not be exactly ``"frame"`` or ``"series"`` (:issue:`59124`)
618619
- Bug in :meth:`read_stata` raising ``KeyError`` when input file is stored in big-endian format and contains strL data. (:issue:`58638`)
619620
- Bug in :meth:`read_stata` where extreme value integers were incorrectly interpreted as missing for format versions 111 and prior (:issue:`58130`)
621+
- Bug in :meth:`read_stata` where the missing code for double was not recognised for format versions 105 and prior (:issue:`58149`)
620622

621623
Period
622624
^^^^^^
623-
-
625+
- Fixed error message when passing invalid period alias to :meth:`PeriodIndex.to_timestamp` (:issue:`58974`)
624626
-
625627

626628
Plotting

pandas/_libs/lib.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,7 @@ def maybe_convert_objects(ndarray[object] objects,
27022702
if using_string_dtype() and is_string_array(objects, skipna=True):
27032703
from pandas.core.arrays.string_ import StringDtype
27042704

2705-
dtype = StringDtype(storage="pyarrow_numpy")
2705+
dtype = StringDtype(storage="pyarrow", na_value=np.nan)
27062706
return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)
27072707

27082708
elif convert_to_nullable_dtype and is_string_array(objects, skipna=True):

pandas/_libs/tslibs/nattype.pyx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,13 @@ class NaTType(_NaT):
441441
442442
Monday == 1 ... Sunday == 7.
443443
444+
See Also
445+
--------
446+
Timestamp.weekday : Return the day of the week with Monday=0, Sunday=6.
447+
Timestamp.isocalendar : Return a tuple containing ISO year, week number
448+
and weekday.
449+
datetime.date.isoweekday : Equivalent method in datetime module.
450+
444451
Examples
445452
--------
446453
>>> ts = pd.Timestamp('2023-01-01 10:00:00')

pandas/_libs/tslibs/offsets.pyx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4752,20 +4752,16 @@ def _validate_to_offset_alias(alias: str, is_period: bool) -> None:
47524752
alias.lower() not in {"s", "ms", "us", "ns"} and
47534753
alias.upper().split("-")[0].endswith(("S", "E"))):
47544754
raise ValueError(INVALID_FREQ_ERR_MSG.format(alias))
4755-
if (is_period and
4756-
alias.upper() in c_OFFSET_TO_PERIOD_FREQSTR and
4757-
alias != "ms" and
4758-
alias.upper().split("-")[0].endswith(("S", "E"))):
4759-
if (alias.upper().startswith("B") or
4760-
alias.upper().startswith("S") or
4761-
alias.upper().startswith("C")):
4762-
raise ValueError(INVALID_FREQ_ERR_MSG.format(alias))
4763-
else:
4764-
alias_msg = "".join(alias.upper().split("E", 1))
4765-
raise ValueError(
4766-
f"for Period, please use \'{alias_msg}\' "
4767-
f"instead of \'{alias}\'"
4768-
)
4755+
if (
4756+
is_period and
4757+
alias in c_OFFSET_TO_PERIOD_FREQSTR and
4758+
alias != c_OFFSET_TO_PERIOD_FREQSTR[alias]
4759+
):
4760+
alias_msg = c_OFFSET_TO_PERIOD_FREQSTR.get(alias)
4761+
raise ValueError(
4762+
f"for Period, please use \'{alias_msg}\' "
4763+
f"instead of \'{alias}\'"
4764+
)
47694765

47704766

47714767
# TODO: better name?

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,6 +2775,13 @@ default 'raise'
27752775
27762776
Monday == 1 ... Sunday == 7.
27772777
2778+
See Also
2779+
--------
2780+
Timestamp.weekday : Return the day of the week with Monday=0, Sunday=6.
2781+
Timestamp.isocalendar : Return a tuple containing ISO year, week number
2782+
and weekday.
2783+
datetime.date.isoweekday : Equivalent method in datetime module.
2784+
27782785
Examples
27792786
--------
27802787
>>> ts = pd.Timestamp('2023-01-01 10:00:00')

0 commit comments

Comments
 (0)