Posts about python

FRED API
Accessing the FRED API with Python

FRED is a database with time series data on economic indicators from a wide variety of sources. There is an API to access all of this data, and in this post I will go over a recent project where I needed to collect all of it.

Read More
Arc Diagram Graphic
Arc Diagrams in D3.js: Visualizing Taxi Pickup and Dropoff Data

An arc diagram is a type of network graph where the nodes lie along one axis, with arcs connecting them. This post is part one of two, where we will prepare the data to visualize pickup and dropoff locations for ride hailing app rides in NYC.

Read More
time_series.png
Time Series Data In Pandas: An Introduction

Time series data is all the rage these days, and not just in fields like finance. In this post we will look at working with time series data in Pandas, how to do basic time-based manipulations and calculations such as rolling means and data shifting.

Read More
using word vector features with scikit-learn (featuring spacy)
Building a custom Scikit-learn Transformer using GloVe vectors from Spacy as features

Word vectors are useful in NLP tasks to preserve the context or meaning of text data. In this post we will use Spacy to obtain word vectors, and transform the vectors into a feature matrix that can be used in a Scikit-learn pipeline.

Read More
voronoimazecover.png
Python Maze Generator Part II: Voronoi Diagrams

Voronoi diagrams are used in a variety of fields for a variety of reasons, including the art and design world. This post is Part II in a series on mazes, where I will generate and solve random mazes from Voronoi diagrams using Python and Matplotlib.

Read More
Rihanna coreference resolution paragraph graphic
Coreference resolution in Python with Spacy + NeuralCoref

Coreference resolution is a task in Natural Language Processing that aims to group together all references to an entity, for example, a person like Rihanna, in text. In this post we use NeuralCoref - a Spacy extension - to do this in Python.

Read More
convex_hull.png
Convex hulls in Python: the Graham scan algorithm

Computing the convex hull of a set of points is a fundamental problem in computational geometry, and the Graham scan is a common algorithm for it. In this post we will implement the algorithm in Python and look at interesting uses of convex hulls.

Read More
dresspixelated.jpg
Determining how similar two images are with Python + Perceptual Hashing

Years ago I had an app idea where users could upload an image of a fashion item like shoes, and it would identify them. In this post I will go over how I approached the problem using perceptual hashing in Python with Pillow and the imagehash library.

Read More
textnormalization.png
Text Normalization for Natural Language Processing in Python

Text Normalization is an important part of preprocessing text for Natural Language Processing. There are several common techniques that we will go over in this post, using the Natural Language Toolkit (NLTK) in Python.

Read More
martinigraph.png
Python Project: Which cocktails can you make from a list of ingredients?

For many of us, going out to restaurants and bars is but a distant memory, and you might want to make your own cocktails at home. In this post we will build a program in Python to tell you what cocktails you can make from a list of input ingredients.

Read More
analyticsgraph.png
Accessing the Google Analytics Reporting API (V4) with Python

How to access the Google Analytics API with Python and create reports with your analytics data. This API seems complicated at first, but once you get the hang of how things work it's easy to generate new and interesting reports.

Read More
sudoku.png
Generating and solving Sudoku puzzles with Python

You might be familiar with Sudoku - the single-player puzzle that involves inserting the numbers 1-9 into a grid in a certain way. In this post we will generate and solve Sudoku puzzles with Python using a depth-first search backtracking algorithm.

Read More
funnelgraph.png
Feature Engineering with Python + Pandas: An Introduction

Feature Engineering is an important skill in data science, and is the process of taking raw data and turning it into features that can be used as inputs for training machine learning algorithms. We will look at 311 noise complaints data in this post.

Read More
dirtydata.png
Data cleaning with Python + Pandas: An Introduction

Cleaning up dirty, corrupted data with Python and Pandas. Dirty, corrupted data leads to dirty and corrupt analysis and conclusions. Who wants that? In this post we will go through a cleaning checklist with Pandas and a dataset from NYC Open Data.

Read More
namedentityvogue.png
How to train a custom Named Entity Recognizer with Spacy

In this post we will train a custom Named Entity Recognizer in Python with Spacy. I will go through the steps to prepare your data and train a model with it. Inspiration credit: text for the graphic is from Vogue magazine - link in post.

Read More
polygons.png
Point in Polygon search with GeoDjango

Determining if a point lies in a polygon is a pretty common task in computational geometry. In this post we will use it to answer questions like 'which NYC neighborhood is this apartment building in?' using GeoDjango and data from NYC Open Data.

Read More
nyctaxisecond.png
Accessing NYC Open Data with Python + the Socrata Open Data API

If the walls in NYC could talk, they would likely tell you a similar story as one you can glean from 311 complaints. Noise complaints, building complaints, rat sightings, etc. NYC Open Data provides us this data, which we can access using Python.

Read More
NER graphic
Named Entity Recognition in Python with Stanford-NER and Spacy

Named Entity Recognition is a common task in Natural Language Processing that aims to label things like person or location names in text data. Today we will look at two examples in Python, using the popular libraries Stanford NLP and Spacy.

Read More
2020zoomblur500.png
Anatomy Of A Web-Scraping Robot

What is a bot? Robots are bad, right? Not always. At its core a robot is just a program to automate various things you could do as a human, such as visiting websites. I will outline the parts, or anatomy, making up such a robot in Python.

Read More
twitter_blog_clouds500flattened.png
Tweeting with Python

How to access the Twitter API with Python using the Tweepy library. I will demonstrate how to connect to the API and do regular Twitter things like tweeting, following and favoriting, all using the API.

Read More
flattenedwarpedcurveddress.png
Classifying Fashion Articles with Python and Scikit-learn

Text classification is a popular and important problem that we deal with on a daily basis. I will be creating a text classifier with Python and scikit-learn to filter a collection of articles based on whether or not they are fashion-related or not.

Read More
robotbackground500.png
What is web scraping?

Web scraping can mean a lot of things, but it usually refers to writing a program to visit websites and extract information from them. It can be a great tool when you need customized data, and I will demonstrate this with a scraper written in Python.

Read More