Use a virtual-env first
cd <to-your-working-directory>
python3 -m venv venv
source venv/bin/activate
Your prompt will change accordingly, to indicate you are using the virtual environment. Any next session (either a new terminal, new terminal tab or simply a new login) only requires the source venv/bin/activate in that working directory, not the python -m venv part.
Now install NumPy
python3 -m pip install numpy
and install whatever else you need.
This will install a newer NumPy in that virtual environment; it is shielded from the system Python, so it can't break your system.
Now do your analysis / coding / whatever you want to do.
Note that I have explicitly used Python 3 here. The python command (and similar the pip command) may refer to Python 2, and that won't work with newer packages such as NumPy 2. Using python3 explicitly will ensure you don't accidentally use Python 2.
Usuing python3 -m pip in a virtual environment, is technically not necessary anymore(*), but it's a good enough habit to be clear what is going on, that I'll leave it like that.
(*) within a virtual environment, python and pip will refer to the Python you used to create that v-venv, which was the system Python 3.
python3-numpyUbuntu package), you can't upgrade it withpip.