fix BUG #58524
- [ ] closes #58524
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Changed it to check the last character of the string so it handles if numbers in front. Works with the example, but not sure about if there are other cases that would break this. The fix seems almost too simple. Let me know :) 
Modified my PR to parse the characters in freqstr and check that for more flexibility Hi, when I run the pre-commit hooks pre-commit run --hook-stage manual --all-files, all the lines pass, but it seems like I have many failing checks. Could I have some guidance with how to understand which tests are failing and if there are issues with how I write my code? Thanks Hey, the pre-commit code checks are actually passing, the problem here is that some of the unit tests are failing

See this guide for running the unit tests locally: https://pandas.pydata.org/docs/dev/development/contributing_codebase.html#running-the-test-suite Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.