Skip to content

Conversation

snitish
Copy link
Member

@snitish snitish commented Jan 10, 2025

In case of all-NA values, pandas.core.array_algos.replace.compare_or_regex_search throws a ValueError as it calls np.vectorize without specifying otypes. Specifying otypes lets np.vectorize work with empty arrays.

@mroeschke mroeschke added the replace replace method label Jan 10, 2025
@mroeschke mroeschke added this to the 3.0 milestone Jan 10, 2025
@mroeschke mroeschke merged commit 8f9039d into pandas-dev:main Jan 10, 2025
55 checks passed
@mroeschke
Copy link
Member

Thanks @snitish

@snitish snitish deleted the issue60688 branch February 6, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
replace replace method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: ValueError in pandas.DataFrame.replace with regex on single-row DataFrame with None/NaN
2 participants