Member-only story
How to use the scipy library in Excel’s Python plug-in module
I have been experimenting with Excel’s Python module and learned that a number of Python libraries are hard encoded into the module. The libraries that are automatically imported into Excel’s Python module are:-
- Numpy
- Pandas
- Statsmodels
- Matplotlib
- Seaborn
One library missing from that list is Python’s scientific library, scipy.
I happen to like scipy and find it easier to work with than statsmodels. For example, to perform a one-way ANOVA test, I only have to code:-
The same one-way ANOVA test in statsmodels is:-
Therefore, whenever possible, I would prefer to use the scipy library over the statsmodels library.
Because scipy is not automatically included in Excel’s Python model, the library must be imported.