From the course: Python in Excel

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Excel values and Python objects

Excel values and Python objects

From the course: Python in Excel

Excel values and Python objects

- [Tutor] The Python cells that we've seen so far return Python objects. They show a data type, and if we have one value returned we can see that value as well. We can use those values in Excel calculations. But if our Python returns more than one value, for example, a data frame, we can change the output type of the cell to show those values in the Excel grid. In this sheet, I have a Python cell that returns a value. This is a Python object and if a Python object returns one value I can use that value in a regular Excel calculation. For example, here I'll write, '=', I'll select that cell and I'll multiply it by two. Let's create another Python solve that uses the values from our imported table. Here in cell E1, I'll type '=py' opening parenthesis, and then I'll define a new variable, T. I'll switch to my scores data and bring in that whole table. And I'll add 'headers=True'. I'll press control enter. Now I have a cell…

Contents