Python Linked Lists

A linked list is one of the most common data structures used in computer science. It is also one of the simplest ones too, and is as well as fundamental to higher level structures like stacks, circular buffers, and queues. Generally speaking, a list is a collection of single data elements that are connected via references. C programmers know this as pointers. For example, a data element can consist of address data, geographical data, geometric data, routing information, or transaction […]

Read more

TensorFlow Neural Network Tutorial

TensorFlow is an open-source library for machine learning applications. It’s the Google Brain’s second generation system, after replacing the close-sourced DistBelief, and is used by Google for both research and production applications. TensorFlow applications can be written in a few languages: Python, Go, Java and C. This post is concerned about its Python version, and looks at the library’s installation, basic low-level components, and building a feed-forward neural network from scratch to perform learning on a real dataset. The training […]

Read more

Python’s os and subprocess Popen Commands

Introduction Python offers several options to run external processes and interact with the operating system. However, the methods are different for Python 2 and 3. Python 2 has several methods in the os module, which are now deprecated and replaced by the subprocess module, which is the preferred option in Python 3. Throughout this article we’ll talk about the various os and subprocess methods, how to use them, how they’re different from each other, on what version of Python they […]

Read more

Using Machine Learning to Predict the Weather: Part 1

Part 1: Collecting Data From Weather Underground This is the first article of a multi-part series on using Python and Machine Learning to build models to predict weather temperatures based off data collected from Weather Underground. The series will be comprised of three different articles describing the major aspects of a Machine Learning project. The topics to be covered are: Data collection and processing (this article) Linear regression models (article 2) Neural network models (article 3) The data used in […]

Read more

Using Machine Learning to Predict the Weather: Part 2

This article is a continuation of the prior article in a three part series on using Machine Learning in Python to predict weather temperatures for the city of Lincoln, Nebraska in the United States based off data collected from Weather Underground’s API services. In the first article of the series, Using Machine Learning to Predict the Weather: Part 1, I described how to extract the data from Weather Underground, parse it, and clean it. For a summary of the topics […]

Read more

Introduction to Regular Expressions in Python

In this tutorial we are going to learn about using regular expressions in Python, including their syntax, and how to construct them using built-in Python modules. To do this we’ll cover the different operations in Python’s re module, and how to use it in your Python applications. What are Regular Expressions? Regular expressions are basically just a sequence of characters that can be used to define a search pattern for finding text. This “search engine” is embedded within the Python […]

Read more

Python Modules: Creating, Importing, and Sharing

Introduction Modules are the highest level organizational unit in Python. If you’re at least a little familiar with Python, you’ve probably not only used ready modules, but also created a few yourself. So what exactly is a module? Modules are units that store code and data, provide code-reuse to Python projects, and are also useful in partitioning the system’s namespaces in self-contained packages. They’re self-contained because you can only access a module’s attributes after importing it. You can also understand […]

Read more

Loops in Python

Choosing the Right Loop Construct Python offers a variety of constructs to do loops. This article presents them and gives advice on their specific usage. Furthermore, we will also have a look at the performance of each looping construct in your Python code. It might be surprising for you. Loops, Loops, Loops A programming language typically consists of several types of basic elements, such as assignments, statements, and loops. The idea behind a loop is to repeat single actions that […]

Read more

Reading and Writing XML Files in Python

XML, or Extensible Markup Language, is a markup-language that is commonly used to structure, store, and transfer data between systems. While not as common as it used to be, it is still used in services like RSS and SOAP, as well as for structuring files like Microsoft Office documents. With Python being a popular language for the web and data analysis, it’s likely you’ll need to read or write XML data at some point, in which case you’re in luck. […]

Read more

Understanding Python’s “yield” Keyword

The yield keyword in Python is used to create generators. A generator is a type of collection that produces items on-the-fly and can only be iterated once. By using generators you can improve your application’s performance and consume less memory as compared to normal collections, so it provides a nice boost in performance. In this article we’ll explain how to use the yield keyword in Python and what it does exactly. But first, let’s study the difference between a simple […]

Read more
1 889 890 891 892 893 910