Posts

Showing posts from 2020

Creating a Basic Python Web App with Flask

Image
Simple web applications in Python are easily constructed with the Flask micro-framework.Why would you want a web app and not just a web page?

You can make quite sophisticated web pages with just HTML and Javascript but if you want to incorporate data that needs to be stored somewhere, or needs some sort of sophisticated processing, you might be better off building a proper application.

Traditionally, web applications were written in PHP, JSP or ASP. But these days Python is an perfectly good choice for creating web apps.
In this article we are going to make a simple example of a Python web app using Python and Flask. Here's what we'll do:

1. Get the Flask library for Python and learn how to use it.
2. Writea Flask-based program to provide some simple data. 3. Write a web page template to display that data.
You don't need a high level of skill to follow this tutorial but you do need to have a basic knowledge of Python and HTML, and know what a web page and a server is. I als…

Simple Twitter Statistics with Python and Pandas

Image
Twitter statistics are great to see how well you are engaging with your audience but how are others doing?

If you use Twitter cards or adverts, you can get a very good idea how people are engaging with your tweets from the official Twitter statistics. But what about your friends, your colleagues… your competitors? Just a little bit of Python code (that you can download) might do the trick.


Need An introduction to Python? Just Enough Python
Imagine that you are a global news giant and are wondering just how well you are regarded by your audience compared with, say, CNN, or the BBC. One thing you might do is compare the level of engagement of their tweets and compare them to your own.

While you may not be able to see the same engagement statistics as for your own account, there are some simple stats that you can see. It just takes a little programming and a Twitter Developer account.

I’m going to show you how it is really quite straightforward to monitor the number of retweets and likes…

Plotting with Pandas: An Introduction to Data Visualization

Image
Plotting with Pandas: An Introduction to Data Visualization If you are a budding Data Scientist or Data Journalist, being able to visualize your data gives you the ability to better understand and communicate it.





Visualizing data gives you the opportunity to gain insights into the relationships between elements of that data, to spot correlations and dependencies, and to communicate those insights to others. By following this article you will learn how to plot impressive graphics using Python and Pandas. Here is what you’ll cover: Importing the appropriate librariesGetting data about the weather in LondonProduce a first Pandas visualization using the plot() methodFind out how different types of charts are createdPlotting simple charts: line charts, bar charts, pie charts and scatter diagramsPlotting statistical Pandas charts— spotting unusual eventsBox Plots — Showing the range of dataHistogramsChanging the number of bins to focus on the outliers — Just how often is it really, really w…