Permutations are the number of different combinations you can make when order matters. Permutations are a statistical tool data scientists, and data analysts use from time to time, and it is an important skill to know. To make a permutation function, you will need the itertools library.

To start, import the itertools library.

Next, let’s create a function. I’m going to name my function ‘possibilities.’ Your function can be any name, but you will see ‘possibilities’ as my function in this example.


Grabbing song lyrics using an api is easier then you may think. Not only can you have them right away on your computer, but then you can download them too.

To get started, import the necessary libraries

The API is from api.lyrics.oh. Set your variables for the artist and song you want.


You want to scrape craigslist for the latest rental price for a house, and you don't want to check the web page for it constantly. In a few code lines, you can pull the price from the website and have it in front of you. Let’s get started.

First, import the necessary libraries.

Next, we’ll set up our web scraping process. The page we are requesting is the URL from craigslist.


This is a good thing to try in prep for an interview or just general skills in python. Even if you are not asked in an interview to do this, it is still a good skill to know how to do it.

Let’s start by defining our function.

By defining a function for this, we can create a system that will more easily reverse any string. Creating a function is also more code friendly because it is more general.


In Python, dictionaries are powerful resources that are capable of storing a lot of information. I. this post, I will show you how to create a dictionary with multiple elements and how to delete one of those items.

Let’s name our dictionary people and add our elements.

We have three keys: Steve, Tim, and Frank. Each of these keys has two values, age and last name. If we want to pull our first item, we will do the following:


If you have read my other posts about stock information retrieval, then you’ll be happy to know there is a MUCH simpler way to get the information you want in fewer lines of code. This code is easier to read and takes less time to process. If you have not read my other posts, then you’re in luck because you get to skip to the easy version!

In my previous method to retrieve information, I created a web scraper that would take all the information from Yahoo Finance’s web page. Although it was not the easiest thing to make, it…


Creating a Linear Regression model in python requires imports from the Sci-kit Learn library. It is useful to assess the relationship between two variables.

This example will use heart disease data found on Kaggle's website.


Completing basic math operations is easier than you may think. Operations like addition, subtraction, multiplication, and division are useful for statistics and completing other tasks.

Addition


Creating a dictionary in python is a useful tool that can be applied to machine learning hyper tuning and grid searching. In this blog, I’ll go over how to create a dictionary, go through it, and add items to it.

First, start by creating a variable name for your dictionary. In my example, I called it dict1. You cannot use the name dict because that name is a built-in python function. Dictionaries take squiggly brackets, unlike lists or tuples.

As seen below, Groceries is my first item in the dictionary called a key. It is composed of three elements called…


Defining functions is a great way to demonstrate your coding ability. It shows you know how to create something that doesn't need to be changed every time to run. I mean that you do not have to change numbers or variables to get the outcome you desire. This could be charting graphs without changing the title or axes, but you programmed the graph to update the title and axes accordingly. Another example is adding all the numbers together up to a certain number. In this post, I’ll show you how to do the latter.

If I wanted to add all…

Joseph Hart

Data Scientist

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store