Python News: What's New From April 2023 :

Python News: What's New From April 2023
by:
blow post content copied from  Real Python
click here to view original post


Spring is in bloom, bringing new and exciting developments in the Python world. The last preview release of Python 3.12 before the feature freeze, a new major version of pandas, pip and PyPI improvements, and PyCon US 2023 are a few of them.

Grab a cup of your favorite beverage, sit back comfortably in your chair, and enjoy a fresh dose of Python news from the past month!

Python 3.12.0 Alpha 7 Is Now Available

Python 3.12.0 alpha 7 became available to the public on April 4, marking the final alpha version before the planned transition to the beta phase, which will begin a partial feature freeze. Beyond this point, most development efforts will focus on fixing bugs and making small improvements without introducing significant changes in the codebase. But existing features could be changed or dropped until the release candidate phase.

While we’re still a few months away from the final release in October, we already have a pretty good idea about the most notable features that should make it into Python 3.12:

But you don’t have to wait until the fall to get your hands on these upcoming features. You can check them out today by installing a pre-release version of Python, remembering that alpha and beta releases are solely meant for testing and experimenting. So, never use them in production!

If you happen to find something that isn’t working as expected, then don’t hesitate to submit a bug report through Python’s issue tracker on GitHub. Testing pre-release versions of Python is one of the reasons why they’re available to early adopters in the first place. The whole Python community will surely appreciate your help in making the language as stable and reliable as possible.

The Python 3.12.0 alpha 7 release brings us one step closer to the final version, but there’s still a lot of work to be done. These ongoing efforts may sometimes affect the official release schedule, so keep an eye on it and stay tuned for more updates in the coming months.

pandas 2.0 Receives a Major Update With PyArrow Integration

The popular Python data analysis and manipulation library pandas has recently released its latest version, pandas 2.0.0, followed by a patch release shortly after. These updates finalize a release candidate that became available a few months ago.

Historically, pandas has relied on NumPy as its back end for storing DataFrame and Series containers in memory. This release introduces an exciting new development in the form of optional PyArrow engine support, providing the Apache Arrow columnar data representation. However, nothing is changing by default, as the developers behind pandas aim to accommodate their large user base and avoid introducing breaking changes.

You now have the option to request the PyArrow back end instead of NumPy, as you can see in the following code snippets:

>>>
>>> import pandas as pd

>>> pd.Series([1, 2, None, 4], dtype="int64[pyarrow]")
0       1
1       2
2    <NA>
3       4
dtype: int64[pyarrow]

>>> df = pd.read_csv("file.csv", engine="pyarrow", dtype_backend="pyarrow")
>>> df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 21 entries, 0 to 20
Data columns (total 9 columns):
 #   Column          Non-Null Count  Dtype
---  ------          --------------  -----
 0   date            21 non-null     date32[day][pyarrow]
 1   transaction_no  21 non-null     int64[pyarrow]
 2   payment_method  21 non-null     string[pyarrow]
 3   category        21 non-null     string[pyarrow]
 4   item            21 non-null     string[pyarrow]
 5   qty             21 non-null     double[pyarrow]
 6   price           21 non-null     string[pyarrow]
 7   subtotal        21 non-null     string[pyarrow]
 8   comment         21 non-null     string[pyarrow]
dtypes: date32[day][pyarrow](1), double[pyarrow](1), int64[pyarrow](1), string[pyarrow](6)
memory usage: 1.8 KB

Read the full article at https://realpython.com/python-news-april-2023/ »


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]


May 10, 2023 at 07:30PM
Click here for more details...

=============================
The original post is available in Real Python by
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce