Skip to content

Commit f901d8d

Browse files
Merge remote-tracking branch 'upstream/main' into ea-cast-pointwise
2 parents dae0934 + 080b6b5 commit f901d8d

File tree

25 files changed

+624
-323
lines changed

25 files changed

+624
-323
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
run: mv doc/build/html web/build/docs
9494

9595
- name: Save website as an artifact
96-
uses: actions/upload-artifact@v5
96+
uses: actions/upload-artifact@v6
9797
with:
9898
name: website
9999
path: web/build

.github/workflows/wheels.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
python -m pip install build
6565
python -m build --sdist
6666
67-
- uses: actions/upload-artifact@v5
67+
- uses: actions/upload-artifact@v6
6868
with:
6969
name: sdist
7070
path: ./dist/*
@@ -138,7 +138,7 @@ jobs:
138138
# removes unnecessary files from the release
139139
- name: Download sdist (not macOS)
140140
#if: ${{ matrix.buildplat[1] != 'macosx_*' }}
141-
uses: actions/download-artifact@v6
141+
uses: actions/download-artifact@v7
142142
with:
143143
name: sdist
144144
path: ./dist
@@ -197,7 +197,7 @@ jobs:
197197
shell: bash -el {0}
198198
run: for whl in $(ls ./dist/*.whl); do wheel unpack $whl -d /tmp; done
199199

200-
- uses: actions/upload-artifact@v5
200+
- uses: actions/upload-artifact@v6
201201
with:
202202
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
203203
path: ./dist/*.whl
@@ -229,11 +229,11 @@ jobs:
229229

230230
steps:
231231
- name: Download all artefacts
232-
uses: actions/download-artifact@v6
232+
uses: actions/download-artifact@v7
233233
with:
234234
path: dist # everything lands in ./dist/**
235235

236-
# TODO: This step can be probably be achieved by actions/download-artifact@v6
236+
# TODO: This step can be probably be achieved by actions/download-artifact@v7
237237
# by specifying merge-multiple: true, and a glob pattern
238238
- name: Collect files
239239
run: |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Announcement: pandas 3.0.0 release candidate ready for testing! Read more <a href="https://pandas.pydata.org/community/blog/pandas-3.0-release-candidate.html">in the blog post</a>

doc/source/_static/schemas/01_table_dataframe.svg

Lines changed: 48 additions & 262 deletions
Loading

doc/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
# This shows a warning for patch releases since the
259259
# patch version doesn't compare as equal (e.g. 2.2.1 != 2.2.0 but it should be)
260260
"show_version_warning_banner": False,
261+
"announcement": "https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/_templates/docs-announcement-banner.html",
261262
"icon_links": [
262263
{
263264
"name": "X",

doc/source/getting_started/intro_tutorials/01_table_oriented.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ SQL table or the ``data.frame`` in `R <https://www.r-project.org/>`__.
7272
- The column ``Name`` consists of textual data with each value a
7373
string, the column ``Age`` are numbers and the column ``Sex`` is
7474
textual data.
75+
- The index labels each row. By default, this is a sequence of integers
76+
starting at 0.
7577

7678
In spreadsheet software, the table representation of our data would look
7779
very similar:

doc/source/whatsnew/v3.0.0.rst

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ and how to adapt your code to the new default.
8080

8181
.. _whatsnew_300.enhancements.copy_on_write:
8282

83-
Copy-on-Write
84-
^^^^^^^^^^^^^
83+
Consistent copy/view behaviour with Copy-on-Write
84+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8585

8686
The new "copy-on-write" behaviour in pandas 3.0 brings changes in behavior in
8787
how pandas operates with respect to copies and views. A summary of the changes:
@@ -101,9 +101,10 @@ copy or a view depended on the exact operation performed, which was often
101101
confusing).
102102

103103
Because every single indexing step now behaves as a copy, this also means that
104-
"chained assignment" (updating a DataFrame with multiple setitem steps) will
105-
stop working. Because this now consistently never works, the
106-
``SettingWithCopyWarning`` is removed.
104+
**"chained assignment"** (updating a DataFrame with multiple setitem steps)
105+
**will stop working**. Because this now consistently never works, the
106+
``SettingWithCopyWarning`` is removed, and defensive ``.copy()`` calls to
107+
silence the warning are no longer needed.
107108

108109
The new behavioral semantics are explained in more detail in the
109110
:ref:`user guide about Copy-on-Write <copy_on_write>`.
@@ -130,10 +131,18 @@ and will be removed in pandas 4.0.
130131

131132
.. _whatsnew_300.enhancements.col:
132133

133-
``pd.col`` syntax can now be used in :meth:`DataFrame.assign` and :meth:`DataFrame.loc`
134-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134+
Initial support for ``pd.col()`` syntax to create expressions
135+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
135136

136-
You can now use ``pd.col`` to create callables for use in dataframe methods which accept them. For example, if you have a dataframe
137+
This release introduces :func:`col` to refer to a DataFrame column by name
138+
and build up expressions.
139+
140+
This can be used as a simplified syntax to create callables for use in
141+
methods such as :meth:`DataFrame.assign`. In practice, where you would
142+
have to use a ``lambda`` function before, you can now use ``pd.col()``
143+
instead.
144+
145+
For example, if you have a dataframe
137146

138147
.. ipython:: python
139148
@@ -151,6 +160,18 @@ you can now write:
151160
152161
df.assign(c = pd.col('a') + pd.col('b'))
153162
163+
The expression object returned by :func:`col` supports all standard operators
164+
(like ``+``, ``-``, ``*``, ``/``, etc.) and all Series methods and namespaces
165+
(like ``pd.col("name").sum()``, ``pd.col("name").str.upper()``, etc.).
166+
167+
Currently, the ``pd.col()`` syntax can be used in any place which accepts a
168+
callable that takes the calling DataFrame as first argument and returns a
169+
Series, like ``lambda df: df[col_name]``.
170+
This includes :meth:`DataFrame.assign`, :meth:`DataFrame.loc`, and getitem/setitem.
171+
172+
It is expected that the support for ``pd.col()`` will be expanded to more methods
173+
in future releases.
174+
154175
New Deprecation Policy
155176
^^^^^^^^^^^^^^^^^^^^^^
156177
pandas 3.0.0 introduces a new 3-stage deprecation policy: using ``DeprecationWarning`` initially, then switching to ``FutureWarning`` for broader visibility in the last minor version before the next major release, and then removal of the deprecated functionality in the major release. This was done to give downstream packages more time to adjust to pandas deprecations, which should reduce the amount of warnings that a user gets from code that isn't theirs. See `PDEP 17 <https://pandas.pydata.org/pdeps/0017-backwards-compatibility-and-deprecation-policy.html>`_ for more details.

environment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ dependencies:
8686
- natsort # DataFrame.sort_values doctest
8787
- pickleshare # Needed for IPython Sphinx directive in the docs GH#60429
8888
- numpydoc
89-
- pydata-sphinx-theme=0.16
89+
# temporary installed with pip with custom patch until released
90+
# - pydata-sphinx-theme=0.16
9091
- pytest-cython # doctest
9192
- sphinx
9293
- sphinx-design
@@ -126,3 +127,4 @@ dependencies:
126127

127128
- pip:
128129
- tzdata>=2023.3
130+
- https://github.com/jorisvandenbossche/pydata-sphinx-theme/archive/refs/heads/v0.16.1+dismissable-announcement-banner.zip

pandas/core/col.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ def col(col_name: Hashable) -> Expression:
260260
:meth:`DataFrame.assign` or :meth:`DataFrame.loc`, can also accept
261261
``pd.col(col_name)``.
262262
263+
.. versionadded:: 3.0.0
264+
263265
Parameters
264266
----------
265267
col_name : Hashable

pandas/core/generic.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6526,23 +6526,17 @@ def copy(self, deep: bool = True) -> Self:
65266526
65276527
When ``deep=False``, a new object will be created without copying
65286528
the calling object's data or index (only references to the data
6529-
and index are copied). Any changes to the data of the original
6530-
will be reflected in the shallow copy (and vice versa).
6529+
and index are copied). With Copy-on-Write, changes to the original
6530+
will *not* be reflected in the shallow copy (and vice versa). The
6531+
shallow copy uses a lazy (deferred) copy mechanism that copies the
6532+
data only when any changes to the original or shallow copy are made,
6533+
ensuring memory efficiency while maintaining data integrity.
65316534
65326535
.. note::
6533-
The ``deep=False`` behaviour as described above will change
6534-
in pandas 3.0. `Copy-on-Write
6535-
<https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
6536-
will be enabled by default, which means that the "shallow" copy
6537-
is that is returned with ``deep=False`` will still avoid making
6538-
an eager copy, but changes to the data of the original will *no*
6539-
longer be reflected in the shallow copy (or vice versa). Instead,
6540-
it makes use of a lazy (deferred) copy mechanism that will copy
6541-
the data only when any changes to the original or shallow copy is
6542-
made.
6543-
6544-
You can already get the future behavior and improvements through
6545-
enabling copy on write ``pd.options.mode.copy_on_write = True``
6536+
In pandas versions prior to 3.0, the default behavior without
6537+
Copy-on-Write was different: changes to the original *were* reflected
6538+
in the shallow copy (and vice versa). See the :ref:`Copy-on-Write
6539+
user guide <copy_on_write>` for more information.
65466540
65476541
Parameters
65486542
----------

0 commit comments

Comments
 (0)