10.3. Sort out scipy.stats
version#
This section is for those running Python on their own computers.
If you are using Colab, please follow the instruvctions in each notebook.
This week we use a function scipy.stats.permutation_test()
You need scipy stats version > 1.8.0 to run this.
You should check your version by running the following code block.
import scipy as scipy
scipy.version.version
'1.10.0'
If the reported version is less than 1.8.0 you need to update it -
First you can see if running this code block helps (the output of the code cell is should be the new version number 1.9.3, but it may throw an error on your computer):
!pip install scipy==1.9.3
import scipy as scipy
scipy.version.version
Collecting scipy==1.9.3
Using cached scipy-1.9.3-cp39-cp39-macosx_10_9_x86_64.whl (34.3 MB)
Requirement already satisfied: numpy<1.26.0,>=1.18.5 in /Users/joreilly/opt/anaconda3/lib/python3.9/site-packages (from scipy==1.9.3) (1.24.3)
Installing collected packages: scipy
Attempting uninstall: scipy
Found existing installation: scipy 1.10.0
Uninstalling scipy-1.10.0:
Successfully uninstalled scipy-1.10.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gensim 4.3.0 requires FuzzyTM>=0.4.0, which is not installed.
Successfully installed scipy-1.9.3
'1.10.0'
If your version is still <1.8.0 after running that, especially if you are on Windows, or you have an error message, you can try the following:
!pip3 install scipy==1.9.3
import scipy as scipy
scipy.version.version
Requirement already satisfied: scipy==1.9.3 in /Users/joreilly/opt/anaconda3/lib/python3.9/site-packages (1.9.3)
Requirement already satisfied: numpy<1.26.0,>=1.18.5 in /Users/joreilly/opt/anaconda3/lib/python3.9/site-packages (from scipy==1.9.3) (1.24.3)
'1.10.0'
If that still didn’t work try:
Mac: open a terminal (Applications–Utilities–Terminal) and type: conda install -c conda-forge scipy=1.10.0 or if that fails, conda update scipy
Windows: open an Anaconda terminal (spotlight search for anaconda and select the anaconda terminal app) and type: conda install -c conda-forge scipy=1.10.0 or if that fails, conda update scipy
Please try and do this before the tutorial - otherwise your tutor will know you didn’t read the prep work thoroughly ;-)