Repository navigation
Use np.strings in the string accessor - #11746
Merged
Merged
Conversation
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Contributor
🏎️ New personal best! Some benchmarks got better.
🚀 better · 🐌 worse · 💥 now failing · 🩹 fixed · 🤷 not comparable Comparing |
5 tasks done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dcherian
approved these changes
Oct 20, 2026
3 tasks done
headtr1ck
enabled auto-merge (squash)
October 22, 2026 11:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the vectorized functions of
np.stringsin the string accessor, now that the minimum numpy version is 2.2 (as suggested in #11722 (review)).len,startswith/endswith,find/rfind/index/rindex,strip,pad/center/ljust/rjust/zfill,repeat, theis*methods, andcontains/replacewithregex=Falseusenp.stringsforU,SandStringDTypearrays; object arrays keep the elementwise path.5-80x faster for 100k strings (new
StringAccessorasv benchmark), unchanged for object arrays.Fixes results of e.g.
strip,centerandreplaceon dask arrays, which were truncated to a single character.Methods that are not C ufuncs in numpy 2.2 (
upper,lower,translate,slice, ...) or use regular expressions stay elementwise.indexon bytes now raises numpy's "substring not found" instead of "subsection not found".Tests added
User visible changes (including notable bug fixes) are documented in
whats-new.rstAI Disclosure
🤖 Generated with Claude Code