3 secret tips on Python to make interactive graphs and impress your boss.

in #news4 years ago

Data visualisation: 3 secret tips on Python to make interactive graphs and impress your boss.

Along with this article, I will try to enhance Python possibilities to make your graph interactive, good looking and let your boss impressed. The goal behind these tips is to give a better impression and enhance the user/client experience. It works!
As a summary, the 3 goals will be:

siteque --> https://vasd.instructure.com/courses/23860/pages/watch-full-the-new-mutants-movie-2020-online-free-hd

  1. Interactivity (Tips#1, #2 and #3)
  2. Good looking graphs (Tips #3)
  3. Impress your boss (Tips#1, #2 and #3)
    Gif from Giphy.com

siteque --> https://vasd.instructure.com/courses/23860/pages/jenong-2067-online-2020-movie-full-version

These three tips are coming from my experience in front of clients after working for 3 years as a data scientist. If you have other ideas feel free to share in the comment.
In this article, we will cover Tips #1.
Let’s get started.

siteque --> https://vasd.instructure.com/courses/23860/pages/watch-full-once-upon-a-snowman-movie-2020-online-version

  1. Prerequisite
    Before to start, make sure you installed a Python3 version and the following packages:
    Pandas
    Plotly
    Pandas DataReader
    The code below will not run with Python 2
    Once you have ensured that the packages above are installed, we are going to use Pandas DataReader to import market data. In this case, we are going to import data for Tesla.
    If any of these packages are not already installed, you can use the pip command, as shown below.

siteque --> https://vasd.instructure.com/courses/23860/pages/movie-online-after-we-collided-2020-watch-full-free~version

pip install pandas-datareader
pip install DateTime
If you want to read more on algorithmic trading and how to get market data, I highly recommend this brilliant article:

siteque --> https://vasd.instructure.com/courses/23860/pages/full-jenong-after-we-collided-movie-2020-online-free-hd

How to get Market Data from the NYSE in less than 3 lines (Python).
In this article, you will learn to get the stock market data such as price, volume and fundamental data using Python…
towardsdatascience.com
If you are too lazy to read, you can find the lines of code below:

siteque --> https://vasd.instructure.com/courses/23860/pages/watch-demon-slayer-mugen-train-movie-2020-online-free-%7C%7Chd

Lines of code used to import market data
Once you have uploaded the data from Tesla, the output and the dataset which will be used is the following one

siteque --> https://vasd.instructure.com/courses/23860/pages/full-streaming-demon-slayer-mugen-train-free-2020-online-full-version-%7C%7Chd

Image for postImage for post
Expected output after running the code above and Yahoo Finance API.
Now that the prerequisites are solved, we can start by the first tips.

siteque --> https://android.gadgethacks.com/forum/dsgrtrytuyiui-0372995/

Tips 1: Adding a range slider
The first tip that I am going to share with you is the range slide selector. Believe it or not, in one line of code, you can already bring substantial interactivity to your graph.
Instead of having a static graph, the user will be able to choose and zoom on a specific time period.
In the case below, it will be oriented to a financial graph, but you can use it as soon as you have time series.

siteque --> https://onlinegdb.com/BJM7XhTKv

For instance, it can be used for marketing to plot sales over time, or medical engineering to plot recovery evolution. I cannot cover all the different fields, but you got my point about the possibilities of application.
Let’s type the code below:

Output:
Image for postImage for post
The graph above will show the impact of using a range slide selector.
Impressive no?
If you look at the graph above, you can found out that a range slide selector has been added to the graph. The user/client will be able to zoom or zoom out on a specific part of the graph easily.

siteque --> https://www.skreebee.com/read-blog/7708

You can even export it as an HTML with the line of code below and send to a client or a friend.
fig.write_html("/Users/Desktop/MyGraph.html")
If you want to build it from A to Z, follow this step by step video, it is even more breathtaking in real-time:

siteque -->

A tutorial on how to build interactive Python graphs.
Another example where you can import multiple shares as well, and index these shares to the same scale (Source 1). Result below:
Image for postImage for post
Next tips:

siteque --> https://www.skreebee.com/read-blog/7708
https://cox.tribe.so/post/https-vasd-instructure-com-courses-23860-pages-watch-full-the-new-mutants-m--5fb0335139bb470334be7c5e
https://jsfiddle.net/aq68r5wo/
https://ideone.com/9wcvGb
https://paiza.io/projects/piD3Wc-f86MimUg-RKbbiA

In the next article, we will cover how to add an interactive button which will help the client/user to filter data instinctively as shown in the image below.
Image for postImage for post
If you have any question or you want me to cover a specific point on data visualisation, feel free to publish a comment in the Q&A.

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59410.96
ETH 2658.99
USDT 1.00
SBD 2.43