Why We Wanted To Start A Podcast And You Should Too

A couple of weeks ago Trinity Web Media decided to start a podcast. Well, that’s not entirely true — we decided to start a podcast in August of 2017 but made it happen Q1 2018. The New Marketing Show…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to create Data Apps in Python using Streamlit

Streamlit Series — Part I — Hello World!

I had just failed an interview! I got rejected for a role that seemed to be the perfect combo between Data Science, Analytics and Consulting and was fairly disappointing! But I decided it was not going to set me back, rather than use it as a learning step. So I was in the lookout for the next project to build my skills and show case something new, something different.When I came across Streamlit, I started looking into it as I was intrigued:

I was so excited: I had a good project idea and a full roadmap to implement it all the way. They say first you have to envision it and then make it happen and in that sense, it was my first step towards building my web App!

Streamlit is an open-source Python library that makes it easy to build and deploy Web apps for Machine Learning and Data Science projects. And I can confirm, this is definitely the case. It also has a fantastic community that supports you all the way and it’s a great place to exchange ideas and solve problems if you get stuck.

The company recently (June 2020) announced a $21m Series A funding! After some research, I found out that by the end of 2019 there were over 200,000 apps build by the community which saw the potential and benefits of being able to deploy models and visualising data without having to be an application developer!

So here I am, to show you how I did it. Because if I can, so do you!

Before we start, lets make sure we have what we need to.

What we’re NOT going to cover in this article and will assume you have already setup in your system are:

To install the Streamlit library simply type the following using a Linux CLI:

pip install streamlit

Create a directory for all your files including the main app Python script, any other supporting script files or images/files to use e.g.

Note, you might not need this for a “Hello Streamlit World” app, but for a real Machine Learning Applications you most certainly will!

To start with Streamlit, lets create a Hello World Application using the following steps:

If you save the file as myHelloWorld.py and run it by typing streamlit run myHelloWorld.py in the command line, you'll get something like this:

And soon your browser will pop up with your first shiny Web App!

As you can see, the App opens automatically in your browser using localhost:8501 port.

To see the full configuration file, you can type streamlit config show and a long config file will appear in your screen showing the default settings for the App. Among others you'll see these:

Now that we’re equipped with the basics, lets go one step further. Lets try plotting and why keep it simple, lets do animations!

Below, I’ve used a simple script to test animations by plotting randomly generated data points using matplotlib library:

Then by saving the file as testPlotting.py and running it, you will get the following popping up in your browser:

Thank you for reading thus far. Hopefully you’re already thinking about how to get started with your own App by now!

I’m a freelance Principal Management Consultant and applied Data Scientist with broad experience implementing Data Analytics solutions, Digital Transformation and Technology Change for Vendors and Global Banks in Financial Services and Government.

Coming from a solid academic background in Robotics Engineering, skills like mathematics, statistics and programming (luckily) came off the shelve for me, also coupled with the genuinely curious, analytical and inquisitive thinking of an Engineer.

This unique blend of technical skills and industry experience have allowed me to work with a broad range of Clients, helping them bridge the gaps between their Business and Technical teams, and bring critical projects over the line thus delivering great value to their organisation.

Add a comment

Related posts:

Repentance

It was the 3rd of March 2019. The memory of that day is so intense that it is totally unforgettable. In fact, year 2019 itself was quite taxing for my family, so was it for him too. My cancer was…

Hoe Baudet premier gaat worden dankzij zijn felste tegenstanders

Sinds de uitslag van de verkiezingen deze week ontvouwt zich een voorspelbaar scenario. Een mechanisme is in werking gezet dat eigenlijk niet meer te stoppen is en dat uiteindelijk zal leiden tot de…

MNF Prize Picks

-Has seen a much bigger share of the red zone targets of late, getting the same amount of looks as Kupp over the past 5 games (10) -Rams have only given up this many rushing yards to QBs in three out…