Tag: Python
-
Python Exercise for Beginners – Implementing One Hot Encoding
In today’s Python exercise we will create a one-hot encoding algorithm to convert categorical data to a numerical format. The reason why we need to do this is that machine learning algorithms only can deal with numbers, not strings. What is One Hot Encoding? One-hot encoding is a way of representing categorical information in binary […]
-
Python Selenium Webdriver.implicitly_wait(seconds)
This method configures the Python Selenium web driver to wait up to N seconds before it gives up searching for an element on a page. By default, implicitly_wait is set to 0, which means that if an element is not immediately available, it will fail immediately if, upon loading the page, it doesn’t find the […]
-
How to find the Parent Element in a page using Python Selenium WebDriver
This is a quick article to show how you can easily get the parent element of an HTML element using Selenium Webdriver with Python. There is more than one way. Let’s suppose that we want to get an HTML button that has no id or unique CSS class from within an HTML page: 1. Getting […]
-
Python Exercise for Beginners – Getting a list of IP addresses to Whitelist for Cloudflare
In today’s video we are going to be working on a real-life Python script for Devops. Many websites in the world today are protected against DDoS attacks by Cloudflare.Cloudflare provides this protection by serving as an intermediary to all traffic from the web. So instead of a website visitor connecting to the server hosting the […]
-
A tutorial on how to convert a Tensorflow model to Tensorflow.js
In this article, I will take you through the steps that are needed to convert any model in Tensorflow Hub to Tensorflow.JS format, and how you can quickly make a simple interactive page that you can host on any web server on the internet. I am only scratching the surface of what is possible. More […]
-
How to Render a Panda Data Frame as HTML
Sometimes it might be useful to convert a Panda Dataframe to HTML. For instance, you might want to render a panda data frame inside a web page, outside Jupyter Notebook. You can do this by calling the df.to_html() function. Where df is the Panda data frame that you would like to render. Let’s first create […]
-
How to run Object Detection with Tensorflow Lite and a Raspberry PI to Build a Wildlife camera
What is Tensorflow Lite? As the name indicates Tensorflow Lite is the light version of Tensorflow which is design to run on small devices, like mobile phones, tablets, edge devices like the Raspberry PI and etc. Tensorflow lite is composed of two packages: The interpreter: What you normally use when calling TensorFlow lite for inference […]
-
How to make a Python Bot
I am going to show you what you need to do to create a Python bot of your own by giving you a general recipe that you can extend at your will. What is a Python Bot A Python bot is a script that runs 24/7 hours, without needing to sleep or rest, and can perform […]
-
How to create a 3D spinning donut with Python, Blender, and some Donut-shaped math
If you have been sleeping under a donut… I mean rock, you will not have heard yet of the donut-shaped C code that can generate a 3D spinning donut, projected onto 2D using ASCII characters. And if spinning a donut with ASCII characters is not hard enough, and it clearly wasn’t for Andy Sloane, this […]
-
How to create a Panda Dataframe from an HTML table using pandas.read_html
It is possible to use Panda Dataframes to scrape directly an HTML table from a URL. This can be incredibly useful and a quick way to extract useful data, when you are in a hurry. To see how valuable it is, let’s use a concrete example. Imagine that we want to scrape some information about […]