Introduction To Interactive Time Series Visualizations With Plotly In Python

(Source)

Up and running with the powerful plotly visualization library

There comes a time when it’s necessary to move on from even the most beloved tools. Matplotlib has served its purpose of quickly creating simple charts, but I’ve grown frustrated with how much code is required to customize plots or do seemingly easy things like get the x-axis to correctly show dates.

For a while, I’ve been looking for an alternative — not a complete replacement as Matplotlib is still useful for exploration — ideally, a library that has interactive elements and lets me focus on what I want to show instead of getting caught in the how to show it details. Enter plotly, a declarative visualization tool with an easy-to-use Python library for interactive graphs.

In this article, we’ll get an introduction to the plotly library by walking through making basic time series visualizations. These graphs, though easy to make, will be fully interactive figures ready for presentation. Along the way, we’ll learn the basic ideas of the library which will later allow us to rapidly build stunning visualizations. If you have been looking for an alternative to matplotlib, then as we’ll see, plotly is an effective choice.

Interactive Visualization made with a few lines of Plotly code

Read More

Please Steal My Articles

(Source)

A personal license for improving the data science community

When Time Warner’s CEO heard Game of Thrones was the most pirated TV show in the world, he said this was “better than an Emmy”. The show’s director similar comments, saying that the illicit downloads created a “buzz” around the show. Instead of pursuing the perpetrators to the full extent of the law, HBO took a soft stance and let the downloads continue.

While this may seem counterintuitive, the thinking went the more people who found the show through any means, the more talk about it there would be, leading to a greater number of paying customers. Rather than spending fortunes trying to stop the inevitable, HBO accepted the piracy as a positive. While there are certainly other factors at play, this decision seems to be wise in light of the record viewership Game of Thrones would attain.

When I found out my articles s my articles and learns something, regardless of whether they know I wrote the article, the world is a better place.

Read More

How to Write a Jupyter Notebook Extension

(Source)

Make the Jupyter Notebook your playground

Jupyter Notebook Extensions are simple add-ons which can significantly improve your productivity in the notebook environment. They automate tedious tasks such as formatting code or add features like creating a table of contents. While there are numerous existing extensions, we can also write our own extension to do extend the functionality of Jupyter.

In this article, we’ll see how to write a Jupyter Notebook extension that adds a default cell to the top of each new notebook which is useful when there are libraries you find yourself importing into every notebook. If you want the background on extensions, then check out this article. The complete code for this extension is available on GitHub.

The final outcome of the Default cell extension is shown below:

Extension to add a default cell to the top of every notebook.

Read More

Jupyter Notebook Extensions

(Source)

How to get more productivity in the notebook environment

The Jupyter Notebook is a great teaching, exploring, and literate programming environment, but out-of-the-box notebooks are notoriously lacking in features. Fortunately, there are a number of ways, including Jupyter Notebook extensions, to improve this invaluable tool.

Extremely Concise Version

Run the following in a command prompt:

pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install

Start up a Jupyter Notebook and navigate to the new Nbextensions tab:

Jupyter Notebook Extensions Tab

Read More

Python and Slack: A Natural Match

(Source)

How to send Slack messages, post plots, and monitor machine learning models programmatically with Python

Life opens up when you learn just how much you can do with Python. The first shift in my daily workflows came when I read sheets — that I no longer had to waste hours on. Instead, I could spend a few minutes writing a Python program (okay maybe a few hours at first), run the script, and then sit back to watch the tedious work do itself.

A second shift occurred when I realized that nearly any service with an API — thedocs.io/en/latest/)), Twitter (thedocs.io/en/latest/)), Wikipedia (Wikipedia API ), and Slack (Slacker for Python), can be accomplished through Python code.

This means you’re not constrained to interacting with these services in an app, but instead, can write code to automate complex workflows or build new tools.

In this article, we’ll see how to use the Slacker Python library to programmatically interact with Slack. We’ll be able to retrieve any data from a workspace, alter settings for channels and users, post messages, upload files, create applications, and even monitor machine learning results in real time. The complete code is available as a Jupyter Notebook on GitHub.

Real-time monitoring of machine learning in Slack.

Read More