@@ -7,6 +7,9 @@ We're excited to announce the release candidate for pandas 3.0. This major
77release brings significant improvements to pandas, but also features some
88potentially breaking changes.
99
10+ To ensure a smooth pandas 3.0 release, we can use your help to [ test the
11+ release candidate now] ( #call-to-action-test-the-release-candidate ) .
12+
1013## Highlights of pandas 3.0
1114
1215pandas 3.0 introduces several major enhancements:
@@ -20,8 +23,6 @@ pandas 3.0 introduces several major enhancements:
2023 copies
2124- ** New ` pd.col ` syntax** : Initial support for ` pd.col() ` as a simplified syntax
2225 for creating callables in ` DataFrame.assign `
23- - ** Enhanced deprecation policy** : A new 3-stage deprecation process to give
24- downstream packages more time to adapt
2526
2627You can find the complete list of changes in our
2728[ release notes] ( https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html ) .
@@ -36,7 +37,7 @@ updates to your code. The two most significant changes are:
3637Starting with pandas 3.0, string columns are automatically inferred as ` str `
3738dtype instead of the numpy ` object ` (which can store any Python object).
3839
39- ** Example of the change :**
40+ ** Example:**
4041``` python
4142# Old behavior (pandas < 3.0)
4243>> > ser = pd.Series([" a" , " b" ])
@@ -54,35 +55,41 @@ dtype: object # <-- numpy object dtype
5455dtype: str # <-- new string dtype
5556```
5657
57- This change improves performance and type safety, but may require code updates.
58+ This change improves performance and type safety, but may require code updates,
59+ especially for library code that currently looks for "object" dtype when
60+ expecting string data.
61+
5862For more details, see the
59- [ String Data Type Migration Guide ] ( https://pandas.pydata.org/docs/dev/user_guide/migration-3-strings.html ) .
63+ [ migration guide for the new string data type ] ( https://pandas.pydata.org/docs/dev/user_guide/migration-3-strings.html ) .
6064
6165### 2. Consistent copy/view behaviour with Copy-on-Write (CoW)
6266
6367Copy-on-Write is now the default and only mode in pandas 3.0. This makes
6468behavior more consistent and predictable, but requires updates to certain coding
65- patterns:
69+ patterns.
6670
67- ** What you need to update:**
68- - ** Chained assignment** will no longer work. You'll need to use ` .loc ` or
69- ` .iloc ` directly on the DataFrame instead
70- - The ` SettingWithCopyWarning ` is removed (since chained assignment no longer works)
71- - Any indexing operation now always behaves as if it were a copy, so
72- modifications won't affect the original DataFrame
71+ The most impactfull change is that ** chained assignment will no longer work** .
72+ As a result, the ` SettingWithCopyWarning ` is also removed (since there is no
73+ longer ambiguity whether it would work or not).
7374
74- ** Example of the change :**
75+ ** Example:**
7576``` python
7677# Old behavior (pandas < 3.0) - chained assignment
77- df[df[' A ' ] > 0 ][ ' B ' ] = 1 # This might modify df (unpredictable)
78+ df[" foo " ][ df[" bar " ] > 5 ] = # This might modify df (unpredictable)
7879
79- # New behavior (pandas 3.0) - must use . loc
80- df.loc[df[' A ' ] > 0 , ' B ' ] = 1 # This is the correct way
80+ # New behavior (pandas 3.0) - must do the modification in one step (e.g. with . loc)
81+ df.loc[df[" bar " ] > 5 , " foo " ] = 100
8182```
8283
83- [ Copy-on-Write Migration Guide] ( https://pandas.pydata.org/pandas-docs/version/3.0.0/user_guide/copy_on_write.html )
84+ In general, any result of an indexing operation or method now always behaves as
85+ if it were a copy, so modifications of the result won't affect the original
86+ DataFrame.
87+
88+ For more details, see the
89+ [ Copy-on-Write migration guide] ( https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html#migrating-to-copy-on-write ) .
90+
8491
85- ## Call to Action: Test the Release Candidate
92+ ## Call to Action: test the Release Candidate
8693
8794We need your help to ensure a smooth pandas 3.0 release!
8895
@@ -91,13 +98,17 @@ pandas as a dependency, it is strongly recommended to run your test suites with
9198the release candidate, and report any issue to our issue tracker before the
9299official 3.0.0 release.
93100
94- 1 . ** Install the release candidate** and test it with your codebase
95- 2 . ** Run your existing code** to identify any issues or needed updates
96- 3 . ** Report any problems** you encounter on our [ GitHub repository] ( https://github.com/pandas-dev/pandas/issues )
97- 4 . ** Share your migration experiences** with the community
101+ How can you best test the release candidate?
102+
103+ 1 . ** First update to the latest released pandas 2.3** (if you are not already
104+ running that version) and test it with your codebase. It is recommended to
105+ resolve any deprecation warning before upgrading to pandas 3.0.
106+ 2 . ** Install the release candidate** and test it with your codebase
107+ 3 . ** Run your existing code** to identify any issues or needed updates
108+ 4 . ** Report any problems** you encounter on our [ GitHub repository issue tracker] ( https://github.com/pandas-dev/pandas/issues )
98109
99110The more testing we get now, the smoother the final pandas 3.0 release will be
100- for everyone. Your feedback is crucial to making this a successful release!
111+ for everyone. Your feedback is crucial for making this a successful release!
101112
102113### Getting the Release Candidate
103114
0 commit comments