BLD: Pin numpy to < 2
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Thanks @lithomas1  When NumPy 2.0 does come out, I think doing `pip install pandas~=x` where `x` is say 1.3-2.0 will result in invalid installations. Do we want to release patch versions to handle this?  That would probably be a good idea, but I'll let @lithomas1 comment if he has bandwidth to tackle that > When NumPy 2.0 does come out, I think doing `pip install pandas~=x` where `x` is say 1.3-2.0 will result in invalid installations. Do we want to release patch versions to handle this?

I don't think this is such a good idea. Rebuilding those older versions is likely going to be a PITA, and the gain isn't likely to be worth it.

As you might know, this is only going to be an issue for pip (conda has some special mechanism to retroactively apply the pins), so I'm happy telling people to either switch to conda, or follow CI best practices in freezing your package versions. > so I'm happy telling people to either switch to conda

From [JetBrains 2021 survey](https://lp.jetbrains.com/python-developers-survey-2021/?_ga=2.29557308.244764463.1697284691-730495734.1673185276&_gl=1*mqp81y*_ga*NzMwNDk1NzM0LjE2NzMxODUyNzY.*_ga_9J976DJZ68*MTY5NzI4NDY5MC42LjEuMTY5NzI4NDc0NS41LjAuMA), only 21% report using conda. I do not believe it is our role to tell people how they should manage their dependencies.

> or follow CI best practices in freezing your package versions

I don't think there is any data here, but I'd guess from my experience we can't rely on this.

Once NumPy 2.0 comes out, users can always specify `numpy < 2.0` themselves with pip. It might bit a bit of an issue at first, but once the first set of error messages is answered on Stack Overflow, it should be easy to solve :laughing:. So since it's any harder than just putting up a small PR to add the pin, I'm good with not doing so. Yeah, I'm totally happy to pin an issue about this. I opened #55519.

I'll also post something via the pandas Twitter/Mastodon, if I have time, later today.