Skip to content

Commit 87bd44b

Browse files
authored
Merge branch 'main' into shiny-new-feature
2 parents 8e0068a + a329dc3 commit 87bd44b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+743
-322
lines changed

doc/source/user_guide/10min.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ Setting a new column automatically aligns the data by the indexes:
318318

319319
.. ipython:: python
320320
321-
s1 = pd.Series([1, 2, 3, 4, 5, 6], index=pd.date_range("20130102", periods=6))
321+
s1 = pd.Series(
322+
[1, 2, 3, 4, 5, 6],
323+
index=pd.date_range("20130102", periods=6))
322324
s1
323325
df["F"] = s1
324326

doc/source/whatsnew/v3.0.0.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ Other API changes
656656
an empty ``RangeIndex`` or empty ``Index`` with object dtype when determining
657657
the dtype of the resulting Index (:issue:`60797`)
658658
- :class:`IncompatibleFrequency` now subclasses ``TypeError`` instead of ``ValueError``. As a result, joins with mismatched frequencies now cast to object like other non-comparable joins, and arithmetic with indexes with mismatched frequencies align (:issue:`55782`)
659+
- :class:`Series` "flex" methods like :meth:`Series.add` no longer allow passing a :class:`DataFrame` for ``other``; use the DataFrame reversed method instead (:issue:`46179`)
659660
- :meth:`CategoricalIndex.append` no longer attempts to cast different-dtype indexes to the caller's dtype (:issue:`41626`)
660661
- :meth:`ExtensionDtype.construct_array_type` is now a regular method instead of a ``classmethod`` (:issue:`58663`)
661662
- Comparison operations between :class:`Index` and :class:`Series` now consistently return :class:`Series` regardless of which object is on the left or right (:issue:`36759`)
@@ -875,6 +876,7 @@ Other Removals
875876
- Removed the ``method`` keyword in ``ExtensionArray.fillna``, implement ``ExtensionArray._pad_or_backfill`` instead (:issue:`53621`)
876877
- Removed the attribute ``dtypes`` from :class:`.DataFrameGroupBy` (:issue:`51997`)
877878
- Enforced deprecation of ``argmin``, ``argmax``, ``idxmin``, and ``idxmax`` returning a result when ``skipna=False`` and an NA value is encountered or all values are NA values; these operations will now raise in such cases (:issue:`33941`, :issue:`51276`)
879+
- Enforced deprecation of storage option "pyarrow_numpy" for :class:`StringDtype` (:issue:`60152`)
878880
- Removed specifying ``include_groups=True`` in :class:`.DataFrameGroupBy.apply` and :class:`.Resampler.apply` (:issue:`7155`)
879881

880882
.. ---------------------------------------------------------------------------
@@ -1000,6 +1002,7 @@ Numeric
10001002
- Bug in :meth:`Series.dot` returning ``object`` dtype for :class:`ArrowDtype` and nullable-dtype data (:issue:`61375`)
10011003
- Bug in :meth:`Series.std` and :meth:`Series.var` when using complex-valued data (:issue:`61645`)
10021004
- Bug in ``np.matmul`` with :class:`Index` inputs raising a ``TypeError`` (:issue:`57079`)
1005+
- Bug in arithmetic operations between objects with numpy-nullable dtype and :class:`ArrowDtype` incorrectly raising (:issue:`58602`)
10031006

10041007
Conversion
10051008
^^^^^^^^^^
@@ -1014,6 +1017,7 @@ Strings
10141017
^^^^^^^
10151018
- Bug in :meth:`Series.str.zfill` raising ``AttributeError`` for :class:`ArrowDtype` (:issue:`61485`)
10161019
- Bug in :meth:`Series.value_counts` would not respect ``sort=False`` for series having ``string`` dtype (:issue:`55224`)
1020+
- Bug in multiplication with a :class:`StringDtype` incorrectly allowing multiplying by bools; explicitly cast to integers instead (:issue:`62595`)
10171021

10181022
Interval
10191023
^^^^^^^^
@@ -1054,6 +1058,7 @@ MultiIndex
10541058
- :func:`MultiIndex.get_level_values` accessing a :class:`DatetimeIndex` does not carry the frequency attribute along (:issue:`58327`, :issue:`57949`)
10551059
- Bug in :class:`DataFrame` arithmetic operations in case of unaligned MultiIndex columns (:issue:`60498`)
10561060
- Bug in :class:`DataFrame` arithmetic operations with :class:`Series` in case of unaligned MultiIndex (:issue:`61009`)
1061+
- Bug in :meth:`MultiIndex.union` raising when indexes have duplicates with differing names (:issue:`62059`)
10571062
- Bug in :meth:`MultiIndex.from_tuples` causing wrong output with input of type tuples having NaN values (:issue:`60695`, :issue:`60988`)
10581063
- Bug in :meth:`DataFrame.__setitem__` where column alignment logic would reindex the assigned value with an empty index, incorrectly setting all values to ``NaN``.(:issue:`61841`)
10591064
- Bug in :meth:`DataFrame.reindex` and :meth:`Series.reindex` where reindexing :class:`Index` to a :class:`MultiIndex` would incorrectly set all values to ``NaN``.(:issue:`60923`)

pandas/_config/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ def option_context(*args) -> Generator[None]:
503503
)
504504

505505
ops = tuple(zip(args[::2], args[1::2], strict=True))
506+
undo: tuple[tuple[Any, Any], ...] = ()
506507
try:
507508
undo = tuple((pat, get_option(pat)) for pat, val in ops)
508509
for pat, val in ops:

pandas/_libs/include/pandas/parser/pd_parser.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ typedef struct {
3737
int (*parser_trim_buffers)(parser_t *);
3838
int (*tokenize_all_rows)(parser_t *, const char *);
3939
int (*tokenize_nrows)(parser_t *, size_t, const char *);
40-
int64_t (*str_to_int64)(const char *, int64_t, int64_t, int *, char);
41-
uint64_t (*str_to_uint64)(uint_state *, const char *, int64_t, uint64_t,
42-
int *, char);
40+
int64_t (*str_to_int64)(const char *, int *, char);
41+
uint64_t (*str_to_uint64)(uint_state *, const char *, int *, char);
4342
double (*xstrtod)(const char *, char **, char, char, char, int, int *, int *);
4443
double (*precise_xstrtod)(const char *, char **, char, char, char, int, int *,
4544
int *);
@@ -87,12 +86,10 @@ static PandasParser_CAPI *PandasParserAPI = NULL;
8786
PandasParserAPI->tokenize_all_rows((self), (encoding_errors))
8887
#define tokenize_nrows(self, nrows, encoding_errors) \
8988
PandasParserAPI->tokenize_nrows((self), (nrows), (encoding_errors))
90-
#define str_to_int64(p_item, int_min, int_max, error, t_sep) \
91-
PandasParserAPI->str_to_int64((p_item), (int_min), (int_max), (error), \
92-
(t_sep))
93-
#define str_to_uint64(state, p_item, int_max, uint_max, error, t_sep) \
94-
PandasParserAPI->str_to_uint64((state), (p_item), (int_max), (uint_max), \
95-
(error), (t_sep))
89+
#define str_to_int64(p_item, error, t_sep) \
90+
PandasParserAPI->str_to_int64((p_item), (error), (t_sep))
91+
#define str_to_uint64(state, p_item, error, t_sep) \
92+
PandasParserAPI->str_to_uint64((state), (p_item), (error), (t_sep))
9693
#define xstrtod(p, q, decimal, sci, tsep, skip_trailing, error, maybe_int) \
9794
PandasParserAPI->xstrtod((p), (q), (decimal), (sci), (tsep), \
9895
(skip_trailing), (error), (maybe_int))

pandas/_libs/include/pandas/parser/tokenizer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,9 @@ void uint_state_init(uint_state *self);
208208

209209
int uint64_conflict(uint_state *self);
210210

211-
uint64_t str_to_uint64(uint_state *state, const char *p_item, int64_t int_max,
212-
uint64_t uint_max, int *error, char tsep);
213-
int64_t str_to_int64(const char *p_item, int64_t int_min, int64_t int_max,
214-
int *error, char tsep);
211+
uint64_t str_to_uint64(uint_state *state, const char *p_item, int *error,
212+
char tsep);
213+
int64_t str_to_int64(const char *p_item, int *error, char tsep);
215214
double xstrtod(const char *p, char **q, char decimal, char sci, char tsep,
216215
int skip_trailing, int *error, int *maybe_int);
217216
double precise_xstrtod(const char *p, char **q, char decimal, char sci,

pandas/_libs/parsers.pyx

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ from numpy cimport (
6363
cnp.import_array()
6464

6565
from pandas._libs cimport util
66-
from pandas._libs.util cimport (
67-
INT64_MAX,
68-
INT64_MIN,
69-
UINT64_MAX,
70-
)
7166

7267
from pandas._libs import lib
7368

@@ -281,10 +276,8 @@ cdef extern from "pandas/parser/pd_parser.h":
281276
int tokenize_all_rows(parser_t *self, const char *encoding_errors) nogil
282277
int tokenize_nrows(parser_t *self, size_t nrows, const char *encoding_errors) nogil
283278

284-
int64_t str_to_int64(char *p_item, int64_t int_min,
285-
int64_t int_max, int *error, char tsep) nogil
286-
uint64_t str_to_uint64(uint_state *state, char *p_item, int64_t int_max,
287-
uint64_t uint_max, int *error, char tsep) nogil
279+
int64_t str_to_int64(char *p_item, int *error, char tsep) nogil
280+
uint64_t str_to_uint64(uint_state *state, char *p_item, int *error, char tsep) nogil
288281

289282
double xstrtod(const char *p, char **q, char decimal,
290283
char sci, char tsep, int skip_trailing,
@@ -1855,15 +1848,13 @@ cdef int _try_uint64_nogil(parser_t *parser, int64_t col,
18551848
data[i] = 0
18561849
continue
18571850

1858-
data[i] = str_to_uint64(state, word, INT64_MAX, UINT64_MAX,
1859-
&error, parser.thousands)
1851+
data[i] = str_to_uint64(state, word, &error, parser.thousands)
18601852
if error != 0:
18611853
return error
18621854
else:
18631855
for i in range(lines):
18641856
COLITER_NEXT(it, word)
1865-
data[i] = str_to_uint64(state, word, INT64_MAX, UINT64_MAX,
1866-
&error, parser.thousands)
1857+
data[i] = str_to_uint64(state, word, &error, parser.thousands)
18671858
if error != 0:
18681859
return error
18691860

@@ -1920,15 +1911,13 @@ cdef int _try_int64_nogil(parser_t *parser, int64_t col,
19201911
data[i] = NA
19211912
continue
19221913

1923-
data[i] = str_to_int64(word, INT64_MIN, INT64_MAX,
1924-
&error, parser.thousands)
1914+
data[i] = str_to_int64(word, &error, parser.thousands)
19251915
if error != 0:
19261916
return error
19271917
else:
19281918
for i in range(lines):
19291919
COLITER_NEXT(it, word)
1930-
data[i] = str_to_int64(word, INT64_MIN, INT64_MAX,
1931-
&error, parser.thousands)
1920+
data[i] = str_to_int64(word, &error, parser.thousands)
19321921
if error != 0:
19331922
return error
19341923

0 commit comments

Comments
 (0)