Python

Python String Operations

A string is one of the many data types in Python. Some of the other common ones are objects, lists, integers, and dates. At its core, a string is really a list/array of characters. Today we will be Python String Operations. We will cover how to Concatenate, Tokenize, Manipulate, Search strings, and create string templates. Concatenate Concatenating strings is just taking two separate strings and gluing them together. In Python, it is extremely easy. You simply use the ‘+’ symbol to add the strings Read more […]


Python Virtual Environment

By default Python only gives you a single environment for your whole system.  This means when you install Python, or a package using Pip, you are installing that version of python or that version of the python package for the entire system.  And all scripts you run will interact with that same version of python or package. However, there are benefits to having a different python environment for each python application. Each application may have different dependencies. And may have compatibility Read more […]


Python Pandas Tutorial

Pandas is useful for doing data analysis in Python. Today we will discuss how to install Pandas, some of the basic concepts of Pandas Dataframes, then some of the common Pandas use cases. What is Pandas? Pandas is a Python library for doing data analysis. Typically you will use it for working with 1-dimentional series data, or 2-dimentional data called data frames. This might include: Tabular data like SQL tables or Excel spreadsheets Ordered and unordered time series data. Matrix Read more […]


Creating a webpage using Python and Flask

Did you know you can host a webpage using nothing but Python code? You don’t have to use things like IIS or Apache. While you may not get all of the same features. When you are trying to write a simple application. Or if you want to host an API, this route is an option for you. In this article, I will describe how to create a basic webpage using Python and Flask. Prerequisites To follow this tutorial, you need the following three prerequisites: install Python 3 Install Pip Install Read more […]


Error Handling in Python using With and Try

In this article we will discuss error handling using Python With Statements Try/Except/Finally statements, show how to use these in combination, and compare how it works to try/catch code blocks in other languages. What is error handling? Error handling is when you put in some extra code to tell your script what to do when things don’t go totally to plan. perhaps you try to open a file that isn’t there. Or perhaps a user puts in unexpected input. Without any error handling, your program Read more […]


Creating word clouds with Python

Creating word clouds in Python is easy thanks to a few open source libraries. Today, we we’ll use the ammueler word cloud library and matplotlib to draw some word clouds. Word clouds are useful visualization tools for looking at the general theme of a document. As a document contains more instances of a given word, that word gets larger in the word cloud, and other words get smaller. Prerequisites Before we get started, you will need to install the prerequisites by running the following commands:

If Read more […]


Graphing using Python and Matplotlib

In this article I will introduce you to graphing in python using matplotlib. There are many kinds of charts you can use with matplot lib. By the end of this article, you should understand how to draw basic bar, line, and scatterplot charts. As you go through each of the example charts, you will see there are two arrays. These arrays are for the X and Y axis. And will sometimes include labels for the values on the chart. Prerequisites Before you get started, you will need to install the prerequisites. Read more […]


Building a classifier using Python and Scikit Learn

Scikit Learn is an easy to use Machine Learning library for Python. In this article, we will discuss how to create a basic classifier application where you can feed it data, and it will properly classify it for you. In this case we will use data on cars and classify them as Sedans, Pickup Trucks, or Mini Vans. Prerequisites Before we begin, you should be sure that you have pip and python installed. If you do not, check out the article on python basics. The article on Python basics starts off Read more […]


Clock

Python Basics – Getting started with Python

In this article, we will cover python basics. We will discuss what is python, where you can download python from, the basic syntax of python, how to input and output information in and out of your python scripts, how to do loops, conditional operators (if/else/elif), and how to write basic functions. What is Python? Python is a cross platform interpreted programming language that was introduced in 1989. The great thing about Python is that it is cross platform. You can run your basic Python applications Read more […]


Python Switch Statements

In languages like C, you have Switch statements allowing you to evaluate the input, then have a few options for the output.  Switch statements are used in place of a series of if/else statements in order to make your code more readable.  Case statements can also have better performance than a traditional if/else setup.  This is because if you have a bunch of if statements, the system will have to evaluate all of the if statements at the time of execution.  However, with a case statement, it is Read more […]