Skip to content

Commit f2e8246

Browse files
committed
Merge branch 'main' into np-array-copy-keyword
2 parents 6edd0e0 + 3b57972 commit f2e8246

File tree

87 files changed

+366
-3070
lines changed

Some content is hidden

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

87 files changed

+366
-3070
lines changed

.github/workflows/comment-commands.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ jobs:
2424
concurrency:
2525
group: ${{ github.actor }}-preview-docs
2626
steps:
27-
- run: |
28-
if curl --output /dev/null --silent --head --fail "https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"; then
29-
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "Website preview of this PR available at: https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
30-
else
31-
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "No preview found for PR #${{ github.event.issue.number }}. Did the docs build complete?"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
32-
fi
27+
- uses: pandas-dev/github-doc-previewer@master
28+
with:
29+
previewer-server: "https://pandas.pydata.org/preview"
30+
artifact-job: "Doc Build and Upload"
3331
asv_run:
3432
runs-on: ubuntu-22.04
3533
# TODO: Support more benchmarking options later, against different branches, against self, etc

.github/workflows/docbuild-and-upload.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,3 @@ jobs:
9090
name: website
9191
path: web/build
9292
retention-days: 14
93-
94-
- name: Trigger web/doc preview
95-
run: curl -X POST https://pandas.pydata.org/preview/submit/$RUN_ID/$PR_ID/
96-
env:
97-
RUN_ID: ${{ github.run_id }}
98-
PR_ID: ${{ github.event.pull_request.number }}
99-
if: github.event_name == 'pull_request'

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,6 @@ jobs:
7373
env_file: actions-312.yaml
7474
pattern: "not slow and not network and not single_cpu"
7575
pandas_copy_on_write: "1"
76-
- name: "Copy-on-Write 3.11 (warnings)"
77-
env_file: actions-311.yaml
78-
pattern: "not slow and not network and not single_cpu"
79-
pandas_copy_on_write: "warn"
80-
- name: "Copy-on-Write 3.10 (warnings)"
81-
env_file: actions-310.yaml
82-
pattern: "not slow and not network and not single_cpu"
83-
pandas_copy_on_write: "warn"
84-
- name: "Copy-on-Write 3.9 (warnings)"
85-
env_file: actions-39.yaml
86-
pattern: "not slow and not network and not single_cpu"
87-
pandas_copy_on_write: "warn"
8876
- name: "Pypy"
8977
env_file: actions-pypy-39.yaml
9078
pattern: "not slow and not network and not single_cpu"

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ repos:
101101
- repo: https://github.com/pre-commit/pygrep-hooks
102102
rev: v1.10.0
103103
hooks:
104-
- id: python-check-blanket-noqa
105-
- id: python-check-blanket-type-ignore
106104
- id: rst-backticks
107105
- id: rst-directive-colons
108106
types: [text] # overwrite types: [rst]

asv_bench/asv.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// pip (with all the conda available packages installed first,
4242
// followed by the pip installed packages).
4343
"matrix": {
44-
"Cython": ["3.0.5"],
44+
"Cython": ["3.0"],
4545
"matplotlib": [],
4646
"sqlalchemy": [],
4747
"scipy": [],

asv_bench/benchmarks/algos/isin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def setup(self, dtype):
5959
elif dtype in ["str", "string[python]", "string[pyarrow]"]:
6060
try:
6161
self.series = Series(
62-
Index([f"i-{i}" for i in range(N)], dtype=object), dtype=dtype
62+
Index([f"i-{i}" for i in range(N)], dtype=object)._values,
63+
dtype=dtype,
6364
)
6465
except ImportError as err:
6566
raise NotImplementedError from err

asv_bench/benchmarks/frame_methods.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,6 @@ def setup(self):
593593
N = 10000
594594
# this is the worst case, where every column has NaNs.
595595
arr = np.random.randn(N, 100)
596-
# NB: we need to set values in array, not in df.values, otherwise
597-
# the benchmark will be misleading for ArrayManager
598596
arr[::2] = np.nan
599597

600598
self.df = DataFrame(arr)

asv_bench/benchmarks/strings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class Dtypes:
1919
def setup(self, dtype):
2020
try:
2121
self.s = Series(
22-
Index([f"i-{i}" for i in range(10000)], dtype=object), dtype=dtype
22+
Index([f"i-{i}" for i in range(10000)], dtype=object)._values,
23+
dtype=dtype,
2324
)
2425
except ImportError as err:
2526
raise NotImplementedError from err

ci/code_checks.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9393
pandas.TimedeltaIndex.ceil\
9494
pandas.PeriodIndex\
9595
pandas.PeriodIndex.strftime\
96-
pandas.Series.clip\
9796
pandas.Series.rename_axis\
9897
pandas.Series.dt.to_period\
9998
pandas.Series.dt.tz_localize\
@@ -115,7 +114,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
115114
pandas.Series.plot.barh\
116115
pandas.Series.plot.line\
117116
pandas.Series.plot.pie\
118-
pandas.DataFrame.clip\
119117
pandas.DataFrame.plot\
120118
pandas.DataFrame.plot.bar\
121119
pandas.DataFrame.plot.barh\
@@ -181,10 +179,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
181179
pandas.core.groupby.SeriesGroupBy.rolling\
182180
pandas.core.groupby.DataFrameGroupBy.hist\
183181
pandas.core.groupby.DataFrameGroupBy.plot\
182+
pandas.core.groupby.DataFrameGroupBy.corrwith\
184183
pandas.core.groupby.SeriesGroupBy.plot\
185184
pandas.core.window.rolling.Rolling.quantile\
186-
pandas.core.window.expanding.Expanding.quantile\
187-
pandas.api.extensions.ExtensionArray.argsort # There should be no backslash in the final line, please keep this comment in the last ignored function
185+
pandas.core.window.expanding.Expanding.quantile # There should be no backslash in the final line, please keep this comment in the last ignored function
188186
RET=$(($RET + $?)) ; echo $MSG "DONE"
189187

190188
fi

doc/source/reference/arrays.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,21 @@ To create a Series of dtype ``category``, use ``cat = s.astype(dtype)`` or
539539
If the :class:`Series` is of dtype :class:`CategoricalDtype`, ``Series.cat`` can be used to change the categorical
540540
data. See :ref:`api.series.cat` for more.
541541

542+
More methods are available on :class:`Categorical`:
543+
544+
.. autosummary::
545+
:toctree: api/
546+
547+
Categorical.as_ordered
548+
Categorical.as_unordered
549+
Categorical.set_categories
550+
Categorical.rename_categories
551+
Categorical.reorder_categories
552+
Categorical.add_categories
553+
Categorical.remove_categories
554+
Categorical.remove_unused_categories
555+
Categorical.map
556+
542557
.. _api.arrays.sparse:
543558

544559
Sparse

0 commit comments

Comments
 (0)