Calling Python from the formula bar
What this guide will cover
Section titled “What this guide will cover”- Calling NumPy, SciPy, pandas, and arbitrary
pip-installed functions from a cell formula - Referring to variables defined earlier in a Python script from a cell
- Mixing Excel functions and Python calls in the same formula
- Type conversion rules between cell ranges and Python objects
- When to use the formula bar vs. a Python cell vs. the Command window
The short version: write =numpy.mean(A1:A10) in a cell. The formula
engine and the scripting engine are the same engine; the formula
evaluates in-process against the same memory your next script call
will see.
=numpy.mean(A1:A10)=my_dataframe["volume"]=SUM(A1:A10) + scipy.std(B:B)