Python is a dynamically typed language, which means we do not define the type of an object, but that doesn’t mean we can’t declare types as a form of annotation for the sake of documenting our code. The Python docs refer to this as “Type Hints”. See the docs here.

Sometimes, when doing data analysis and building/evaluating machine learning models in Jupyter notebook, we end up writing functions to save ourselves time and frustration. After all why write

(var1 + var2 + var3 + var4 + var5) / 5

when we could just create a reusable function:

Of course…

Abe Flansburg

Software Developer / Data Scientist / Follower of Jesus Christ

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store