-
Book Overview & Buying
-
Table Of Contents
Python in Excel for Data Analytics
By :
Open the ch_04.xlsx workbook to follow along with this chapter's demonstrations. It includes a single sheet with the same fuel mileage data from earlier chapters, stored as an Excel table named mpg and loaded into Python in Excel as mpg_df:
from scipy import stats
mpg_df = xl("mpg[#All]", headers=True)
We will also import scipy.stats, which is one of the available Python in Excel packages. SciPy is a large library for scientific computing, but here we are focusing specifically on its statistical functionality.
In practice, scipy.stats is well suited for many standard statistical tests, while statsmodels is often used for more advanced modeling and estimation. We will start with scipy.stats and build from there.
In the previous chapter, you explored this dataset using summary statistics and visualizations to build intuition about its structure. For example, you may have noticed that average fuel efficiency appears to differ...