From the course: Python Data Analytics: From Notebooks to Production
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution: Convert logs notebook - Python Tutorial
From the course: Python Data Analytics: From Notebooks to Production
Solution: Convert logs notebook
(upbeat music) - [Instructor] Let's have a look at my solution. So here's my code. I created three functions, one is to load the data from the database. The second one is to clean the data, and it turns a DataFrame. And finally, the plot_level_counts, which return an Axes, which is Matplotlib object. And then the user can decide whether to display it on a notebook or maybe save it to a file. And now, in my notebook, I'm inputting logs and then getting the DataFrame. Let's run it. It's Python. And we have 991 records. Then we are cleaning and normalizing, and we drop some records. And finally, we just do the log axis plot level, and then it's going to show us the same chart as before.