|
| 1 | +Title: pandas 3.0.0 release candidate ready for testing |
| 2 | +Date: 2025-12-12 |
| 3 | + |
| 4 | +# pandas 3.0.0 release candidate ready for testing! |
| 5 | + |
| 6 | +We're excited to announce the release candidate for pandas 3.0. This major |
| 7 | +release brings significant improvements to pandas, but also features some |
| 8 | +potentially breaking changes. |
| 9 | + |
| 10 | +## Highlights of pandas 3.0 |
| 11 | + |
| 12 | +pandas 3.0 introduces several major enhancements: |
| 13 | + |
| 14 | +- **Dedicated string data type by default**: String columns are now inferred as |
| 15 | + the new `str` dtype instead of `object`, providing better performance and type |
| 16 | + safety |
| 17 | +- **Consistent copy/view behaviour with Copy-on-Write (CoW)** (a.k.a. getting |
| 18 | + rid of the SettingWithCopyWarning): More predictable and consistent behavior |
| 19 | + for all operations, with improved performance through avoiding unnecessary |
| 20 | + copies |
| 21 | +- **New `pd.col` syntax**: Initial support for `pd.col()` as a simplified syntax |
| 22 | + 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 |
| 25 | + |
| 26 | +You can find the complete list of changes in our |
| 27 | +[release notes](https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html). |
| 28 | + |
| 29 | +## Important changes requiring code updates |
| 30 | + |
| 31 | +As a major release, pandas 3.0 includes some breaking changes that may require |
| 32 | +updates to your code. The two most significant changes are: |
| 33 | + |
| 34 | +### 1. Dedicated string data type by default |
| 35 | + |
| 36 | +Starting with pandas 3.0, string columns are automatically inferred as `str` |
| 37 | +dtype instead of the numpy `object` (which can store any Python object). |
| 38 | + |
| 39 | +**Example of the change:** |
| 40 | +```python |
| 41 | +# Old behavior (pandas < 3.0) |
| 42 | +>>> ser = pd.Series(["a", "b"]) |
| 43 | +>>> ser |
| 44 | +0 a |
| 45 | +1 b |
| 46 | +dtype: object # <-- numpy object dtype |
| 47 | + |
| 48 | +# New behavior (pandas 3.0) |
| 49 | +>>> ser = pd.Series(["a", "b"]) |
| 50 | +>>> ser.dtype |
| 51 | +>>> ser |
| 52 | +0 a |
| 53 | +1 b |
| 54 | +dtype: str # <-- new string dtype |
| 55 | +``` |
| 56 | + |
| 57 | +This change improves performance and type safety, but may require code updates. |
| 58 | +For more details, see the |
| 59 | +[String Data Type Migration Guide](https://pandas.pydata.org/docs/dev/user_guide/migration-3-strings.html). |
| 60 | + |
| 61 | +### 2. Consistent copy/view behaviour with Copy-on-Write (CoW) |
| 62 | + |
| 63 | +Copy-on-Write is now the default and only mode in pandas 3.0. This makes |
| 64 | +behavior more consistent and predictable, but requires updates to certain coding |
| 65 | +patterns: |
| 66 | + |
| 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 |
| 73 | + |
| 74 | +**Example of the change:** |
| 75 | +```python |
| 76 | +# Old behavior (pandas < 3.0) - chained assignment |
| 77 | +df[df['A'] > 0]['B'] = 1 # This might modify df (unpredictable) |
| 78 | + |
| 79 | +# New behavior (pandas 3.0) - must use .loc |
| 80 | +df.loc[df['A'] > 0, 'B'] = 1 # This is the correct way |
| 81 | +``` |
| 82 | + |
| 83 | +[Copy-on-Write Migration Guide](https://pandas.pydata.org/pandas-docs/version/3.0.0/user_guide/copy_on_write.html) |
| 84 | + |
| 85 | +## Call to Action: Test the Release Candidate |
| 86 | + |
| 87 | +We need your help to ensure a smooth pandas 3.0 release! |
| 88 | + |
| 89 | +Especially if you have pandas code in production or maintain a library with |
| 90 | +pandas as a dependency, it is strongly recommended to run your test suites with |
| 91 | +the release candidate, and report any issue to our issue tracker before the |
| 92 | +official 3.0.0 release. |
| 93 | + |
| 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 |
| 98 | + |
| 99 | +The 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! |
| 101 | + |
| 102 | +### Getting the Release Candidate |
| 103 | + |
| 104 | +You can install the pandas 3.0 release candidate from PyPI: |
| 105 | + |
| 106 | +```bash |
| 107 | +python -m pip install --upgrade pandas==3.0.0rc0 |
| 108 | +``` |
| 109 | + |
| 110 | +Or from conda-forge using conda/mamba: |
| 111 | + |
| 112 | +```bash |
| 113 | +conda install -c conda-forge/label/pandas_rc pandas==3.0.0rc0 |
| 114 | +``` |
0 commit comments