Bringing it all together
1. Bringing it all together
You're now going to use your hard-earnt skills to write error messages into your DataFrame analyzer that you have been building up in previous chapters:2. Errors and exceptions
let's say that a user of your function passes your function the name of a column that isn't a column in the DataFrame that they pass it; you'll want to let them know! In the following interactive exercises, you'll write error messages using two methods that you have learned: one, using the try-except syntax that you see here;3. Errors and exceptions
two: explicitly raising errors using the keyword raise as in this example.4. Let's practice!
Now that's enough out of me, happy function writing and error handling!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.