From the course: More Python Tips, Tricks, and Techniques for Data Science

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Errors and debugging

Errors and debugging - Python Tutorial

From the course: More Python Tips, Tricks, and Techniques for Data Science

Start my 1-month free trial

Errors and debugging

- [Instructor] In this video, we'll begin discussing some of the enhancements that IPython adds on top of the normal Python syntax. These are known as magic commands, and these are prefixed with the % character. These magic commands are designed to succinctly solve various common problems in standard data analysis. Now, these come in two flavors, first one is line magics which are denoted by a single % prefix and operate on a single line of input. Now, the second type is called cell magics which are denoted by a double % prefix and operate on multiple lines of input. So first off, we have the % run magic command which is used to run Python script inside the Jupyter Notebook itself. So, to demonstrate this, I have this example.py Python script. And in this I have defined two variables, a and b. Both of them are equal to five. And then I have four functions, sum, product, divide and subtract. So, let's say I want to…

Contents