pandas 3.1.2 arrived on PyPI on 30 November 2026, and the GitHub release page calls it what it is: a patch release in the 3.1.x series with regression fixes and bug fixes, and a recommendation that every user of the 3.1.x series upgrade to it. There are no new features. The official what’s-new page lists ten fixed regressions and one bug fix, contributed by seven people, three of them first-time contributors. That is a small release on paper, and it is easy to skip. The details say otherwise. Three of the regressions sit in read_csv, the function most data pipelines call first. Three more change results without raising an error, which means a pipeline can run to completion and still produce the wrong numbers. This article works from the official what’s-new page for 3.1.2, the GitHub release v3.1.2, and the PyPI page for pandas 3.1.2. Every version number, date, and issue number below comes from one of those three pages.
The release is worth reading in full because patch notes for a library this widely used are also a map of where the last release went wrong. pandas 3.1.0 came out on 22 October 2026, 3.1.1 followed on 4 November, and 3.1.2 landed on 30 November. Three releases in the 3.1 line in about five weeks is a fast cadence for a maintenance branch, and the fixes in 3.1.2 are almost all regressions, which means they are behaviors that worked before and broke in the 3.1 line. A regression is different from a missing feature. A missing feature is something a user asks for and does not get. A regression is something a user already relies on that stops working, often in a place they have no reason to retest. That is why the pandas team recommends the upgrade for all 3.1.x users rather than leaving it to the people who hit a specific error.
What 3.1.2 actually fixes
The what’s-new page groups the changes into fixed regressions and bug fixes. The regression list runs to ten items, and the bug fix list has one. Reading them as a group, they fall into three clusters. The first cluster is input and output: three read_csv regressions and one that also touches read_json and read_xml. The second cluster is silent wrong results: an exponentially weighted moving average that returns incorrect values, a categorical index that answers membership questions wrong, and test assertion messages that hide real differences. The third cluster is type and error handling: sorting that changes a column dtype, a plotting error on timezone-aware data, a wrong exception type from Timestamp.strftime, and a fillna that should raise and does not.
The full regression list, as the release notes state it, covers SparseArray arithmetic with a timedelta64 scalar in an unsupported unit, read_csv returning flat columns instead of a MultiIndex for tuple names on files of 5 MB or more, read_csv with the PyArrow engine converting a non-date index column to strings when parse_dates is set, the three reader functions raising a “ValueError: I/O operation on closed file” when reading from a self-closing stream, assertion functions rounding float values to display.precision in failure messages, CategoricalIndex.__contains__ returning wrong results for categories built from a range, DataFrame.ewm and Series.ewm returning incorrect results with adjust=False and ignore_na=False on data containing NaN when com=1, plotting raising ConversionError on timezone-aware datetime data with missing values, Series.sort_values converting object dtype holding strings to str dtype and raising UnicodeEncodeError for strings with lone surrogates, Timestamp.strftime raising AttributeError instead of TypeError for a non-string format, and fillna on datetime, timedelta, and period arrays not raising on an invalid fill value when the array has no missing values. The single bug fix concerns SparseArray.from_indices, which raised on datetime64 or timedelta64 data in an unsupported unit and silently accepted unsorted, duplicate, or negative indices with kind="block".
None of these is a feature request. Each one is a behavior that the release notes describe as broken relative to what the library did before, and each one carries a GitHub issue number so a reader can trace it back to the report. The issue numbers run from GH 31178 for the ewm problem, which dates back much further than the 3.1 line, to GH 72247 for the CategoricalIndex problem, one of the newest reports in the list. The spread matters. Some of these bugs are old problems that the 3.1 line exposed or re-exposed, and some are fresh reports from users running the new release. A patch release that collects both kinds is doing two jobs at once: repairing the new release and clearing old debt that the new release made visible.
The read_csv regressions in detail
The three read_csv regressions deserve the most attention because read_csv is where most pandas work starts. A bug in a plotting helper affects a chart. A bug in read_csv affects the frame that every later step trusts. The first one is narrow in a way that makes it easy to miss in testing. When a CSV file is 5 MB or larger and the caller passes tuple names, read_csv returned flat columns instead of a MultiIndex. Files under 5 MB were fine. A test suite that reads small fixture files would never see it, and a production job that reads a real export would see it every time. The threshold is the detail that makes this regression dangerous. Small fixtures pass, real data fails, and the failure is silent: the call returns a frame, the columns are just wrong, and downstream code that selects by level of a MultiIndex either fails later or, worse, selects the wrong thing.
The second read_csv regression involves the PyArrow engine. With engine="pyarrow" and parse_dates set, a non-date index_col, for example an integer column, was converted to strings. The column was supposed to stay an integer index. Instead it became strings, which changes joins, merges, and lookups against that index. This one matters because the PyArrow engine is the direction pandas has been moving in for CSV reading, and parse_dates is a common argument in the same call. The combination of the two is not exotic. It is an ordinary call shape, and the regression turns an integer index into a string index without any warning. Code that compares that index against integers after the read would silently find nothing, because "1" is not 1.
The third regression is about streams rather than files. read_csv, read_json, and read_xml raised “ValueError: I/O operation on closed file” when reading from a stream that closes itself once exhausted, such as a requests Response.raw object. This is the pattern used when downloading a file over HTTP and handing the response body straight to a reader without saving it to disk first. The reader consumed the stream, the stream closed itself, and then the reader tried to read from it again and failed. The fix restores the behavior that code written around Response.raw expects: the reader finishes its work before the stream closes, or it stops trying to read after the stream is done. Anyone who fetches CSV or JSON over HTTP and passes the response directly to pandas would have hit this one, and the error message at least made it loud. It is the least silent of the three, and the easiest to work around by saving to a file first, but it is still a regression in a documented workflow.
Taken together, the three read_csv fixes tell a story about where the 3.1 line changed the reader internals. The 5 MB threshold points at a code path that switches behavior by file size, which is the kind of optimization that only shows up in production-sized data. The PyArrow engine issue points at interaction between two options that are each fine alone. The stream issue points at lifecycle handling of the input object. None of these is a single typo. They are the kind of breakage that appears when a subsystem is rewritten, and they are exactly the kind of breakage that a patch release exists to clean up.
The quiet ones that change results
The regressions that should worry a data team most are the ones that do not raise an error. Three fixes in 3.1.2 fall into that group, and each one is worth understanding on its own because each one fails in a different way.
The first is DataFrame.ewm and Series.ewm with adjust=False and ignore_na=False returning incorrect results for data containing NaN when com=1, which is equivalent to span=3, alpha=0.5, or halflife=1. Exponentially weighted moving averages are a standard tool in time series work, and com=1 is a common parameter choice. The combination of adjust=False, ignore_na=False, and missing values is specific, but it is a combination that real analysis code uses, especially in financial and sensor data where missing values are normal. The release notes say the results were incorrect, not that the call failed. A rolling average that is wrong by a little is worse than a crash, because the numbers still look plausible and the chart still draws. The issue number, GH 31178, is far older than the others in the list, which suggests this is a long-standing edge case that the 3.1 line brought back into view rather than a brand-new break.
The second is CategoricalIndex.__contains__ returning wrong results when the categories are constructed from a range. Values present in the index could be reported missing, and unused categories could be reported present. Membership tests are the kind of check that sits inside filtering logic, so a wrong answer here does not just print a wrong boolean. It changes which rows a filter keeps. A range-built categorical index is a natural way to build categories for integer bins or ordered labels, so this is not a contrived input. It is a normal construction that answered membership questions incorrectly, and the wrongness went both ways: present values reported missing and absent values reported present. That is the worst kind of wrong, because no single direction of error would show up as an obvious pattern in the output.
The third is the test assertion rounding. testing.assert_frame_equal, assert_series_equal, and the other assertion functions rounded float values to display.precision in their failure messages, so differing values could look identical. This one is a testing tool bug, and its effect is indirect but serious. When a test fails, the failure message is how a developer decides whether the difference matters. If two values that differ in the tenth decimal place print as the same number, the developer concludes the test is flaky or the tolerance is wrong, instead of finding the real difference. The fix does not change what the assertions accept. It changes what they show when they reject, which is the information a developer needs to debug the failure. A test suite that relies on these messages was getting less information than it should have, and the people running it had no way to know.
These three fixes share a theme. They are all cases where the library produced output that looked right and was wrong, or hid the evidence that would have shown it was wrong. That is why the release notes matter more than the version number. A patch release that only fixed crashes would be easy to evaluate: if nothing crashes, skip it. A patch release that fixes silent wrong results has to be evaluated differently, because the question is not whether anything crashed. The question is whether any result produced since the last release is still trustworthy.
How to check whether 3.1.2 affects a project
This section is a workflow built from the official documentation, not a report of a local test run. No benchmark or timing claim in this article comes from running code against a local machine, and no behavior described here was verified by executing it. The claims come from the release notes, the GitHub release page, and the PyPI page listed in the introduction, and the checks below are steps a reader can run in their own environment to see whether their code is affected. That distinction matters, because the fixes are specific enough that a reader can test them directly instead of taking the release notes on trust.
The first step is to confirm which version is installed. The PyPI page lists wheels for CPython 3.11 through 3.15, including free-threaded builds, and the GitHub release gives two install commands: python -m pip install --upgrade pandas==3.1.* for pip and conda install -c conda-forge pandas=3.1 for conda-forge. A project that pins pandas==3.1.1 in a requirements file or a lockfile will not move until the pin changes, and a project that pins pandas>=3.1,<3.2 will pick up 3.1.2 on the next fresh install. Checking the pin is the fastest way to know whether the upgrade has already happened, and it is also the fastest way to find out whether a deployed job is still running the version with the regressions.
import pandas as pd
print(pd.__version__)
The second step is to match the regression list against the calls a project actually makes. A project that only reads small CSV files with the default engine and never passes tuple names is unlikely to have hit the read_csv regressions. A project that reads files over 5 MB with tuple names, or uses the PyArrow engine with parse_dates and an integer index, or passes a requests response body straight to a reader, has a concrete reason to upgrade and a concrete test to run. The same matching applies to the silent ones. A project that computes exponentially weighted averages with adjust=False and ignore_na=False on data with missing values should rerun its outputs after upgrading and compare them. A project that builds categorical indexes from a range and filters on membership should check its filters. A project whose test suite uses the pandas assertion helpers should rerun failing tests after the upgrade, because the failure messages will now show the real difference.
import pandas as pd
df = pd.read_csv("data.csv", names=[("a", "x"), ("b", "y")])
print(df.columns)
print(df.dtypes)
The third step is to rerun the test suite after upgrading, and to treat any new failure as information rather than as a reason to roll back. A test that passed on 3.1.1 and fails on 3.1.2 is most likely a test that was asserting the old, wrong behavior, or a test whose failure message now shows a real difference that the old message hid. The ewm and CategoricalIndex fixes change results, so code that recorded the old results as expected values will fail, and that failure is the upgrade working as intended. The right response is to check the new result against the release notes, confirm that it matches the fixed behavior, and update the expected value with a comment pointing at the issue number. Rolling back to 3.1.1 to make the test green again would restore the wrong result.
The fourth step is to check the edges that the release notes do not cover. The sort_values fix restores object dtype preservation for string columns, which means code that relied on the 3.1.1 behavior of converting to str dtype will see a different dtype after upgrading. The Timestamp.strftime fix changes an AttributeError into a TypeError, which matters for code that catches a specific exception type. The fillna fix makes invalid fill values raise where they previously passed silently, which means code that passed an invalid fill to an array with no missing values will now fail loudly. None of these is a reason to avoid the upgrade. They are reasons to read the list before upgrading, so that a new error after the upgrade is recognized as a fix rather than mistaken for a new problem.
Where 3.1.2 sits in the 3.1 line
pandas 3.0 arrived on 21 January 2026 with Copy-on-Write enabled by default and text columns stored in a PyArrow-backed string dtype. Those were the two headline changes, and the site covered the migration in the pandas 3.0 migration guide, which walks through testing assignments, missing text, and mixed labels on small fixtures before moving a real project. The 3.1 line then followed quickly: 3.1.0 on 22 October, 3.1.1 on 4 November, and now 3.1.2 on 30 November. The cadence is worth noting because it shows how the maintainers are treating the 3.1 branch. A new minor release every few weeks with patches in between is the pattern of a branch that is being actively stabilized, not one that is frozen.
The contributor list for 3.1.2 is also worth a look. Seven people contributed patches, and three of them are marked with a plus sign in the release notes, which means they contributed a patch for the first time. A patch release that brings in three first-time contributors is a healthy sign for a project of this size. The fixes came from people who hit the bugs in their own work and stayed to fix them, alongside the core team. Joris Van den Bossche and jbrockmendel are familiar names from the project’s history, and their presence on a patch release is normal. The first-timers are the interesting part, because they show that the issue tracker is still a path into the project rather than a wall.
The PyPI page adds a practical detail. The 3.1.2 files include wheels for CPython 3.11 through 3.15, and free-threaded builds for the versions that support them, all uploaded on 30 November with provenance attestations. Free-threaded Python is still new enough that wheel coverage matters, and the fact that the free-threaded wheels shipped on the same day as the regular ones means there is no waiting period for projects running the free-threaded build. The source distribution is 5.9 MB. None of this changes behavior, but it removes the usual friction that makes people postpone a patch upgrade: the install is a single command, the wheels are already there, and the release notes tell the reader exactly what changes.
The wider data stack gives the release its context. Polars 2.2.0, covered in the Polars 2.2.0 article, shipped on 24 November with out-of-core joins that spill to disk. DuckDB 2.0, covered in the DuckDB 2.0 article, shipped in October as a long-term support release. The three libraries are often compared, and the comparison usually focuses on speed at large scale. pandas 3.1.2 is a reminder that the comparison has a second axis. A library that is slower on a billion rows but correct on the rows a team actually has is worth more than a faster library that quietly changes an index dtype. The patch release does not make pandas faster. It makes the version that most teams already run more trustworthy, and that is a different kind of progress.
What to do with it
The practical answer is short. If a project runs pandas 3.1.0 or 3.1.1, upgrade to 3.1.2 and rerun the test suite. If a project still runs pandas 2.3, the upgrade path is different: the pandas team recommends moving to 2.3 first to collect deprecation warnings, and the migration guide on this site walks through that step. If a project runs pandas 3.0, the 3.1 line is the next stop, and 3.1.2 is the version to land on rather than 3.1.0 or 3.1.1, because it contains the fixes for the regressions those two introduced. The release notes do not promise that 3.1.2 is the last patch in the line. They promise that it fixes the regressions listed, and that the maintainers recommend it for all 3.1.x users, and that is enough to act on.
The longer answer is about habit. Patch releases are the easiest upgrades to postpone, because they contain no feature that anyone is waiting for. The cost of postponing is invisible until a pipeline produces a wrong number and someone has to find out why. The read_csv regressions in 3.1.2 are a good example of that cost. A team that reads a 6 MB CSV with tuple names would have gotten flat columns, and the first sign of trouble would have been a downstream failure or a wrong report, not an error at the read. The ewm regression is a better example still, because there is no downstream failure at all. The numbers are just wrong, and nothing in the pipeline says so. Upgrading a patch release takes minutes. Finding a silent wrong result takes hours, and explaining it to the people who used the report takes longer. The release notes for 3.1.2 are short enough to read in one sitting, and they name every issue number, so a reader can check each fix against their own code and decide in an afternoon. That is the whole point of a patch release, and it is why the recommendation on the GitHub page is worth following.
Questions or corrections about this article can be sent to [email protected].
Your notes on this article
Your name or initials, note and date stay in this browser profile. Anyone using the profile can read them. Delete a note below or clear this site’s browser data. To reach the editors, report a correction.
No notes saved here