Skip to content

Instantly share code, notes, and snippets.

@accessnash
accessnash / calculate_pi
Created October 4, 2020 15:45
Calculate Pi using acceptance-rejection
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 4 17:31:12 2020
@author: Localuser
"""
from random import uniform
from math import sqrt
@accessnash
accessnash / airline_passenger.py
Created July 28, 2020 19:18
Using EWMA on airline passenger data
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 28 21:00:55 2020
@author: User
"""
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
@accessnash
accessnash / yelp-review.py
Created July 5, 2020 07:55
NLP methods to analyse Yelp reviews data
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 4 10:08:00 2020
@author: User
"""
import pandas as pd
import seaborn as sns
@accessnash
accessnash / avocado.py
Created June 30, 2020 19:57
Predicting prices for avocados using FB Prophet
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 30 21:09:19 2020
@author: User
"""
import pandas as pd
import seaborn as sns
@accessnash
accessnash / spam-filter.py
Created June 28, 2020 14:49
Email spam filter using NLP
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 28 11:19:47 2020
@author: User
"""
import pandas as pd
import seaborn as sns
@accessnash
accessnash / movie_recommendations.py
Created June 14, 2020 09:44
A basic movie recommendation system using 100,000 data points and 1600+ movies
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 13 09:39:13 2020
@author: User
"""
import pandas as pd
import numpy as np
@accessnash
accessnash / chicago_crimeforecast.py
Created June 7, 2020 10:28
Using FB'sProphet to forecast crime rate in Chicago using historical data from 2005-2017
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 3 21:13:54 2020
@author: Localuser
"""
import pandas as pd
import numpy as np
import seaborn as sns
@accessnash
accessnash / peg-solitaire.py
Created May 30, 2020 10:19
Using a brute force recursive algorithm to solve the board game of peg-jumping
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 09:58:40 2020
@author: Localuser
"""
# A brute force algorithm for a peg-jumping solitaire game
@accessnash
accessnash / mergesort.py
Created May 27, 2020 20:02
Merge Sort : A divide and conquer algorithm with a performance of the order O(n*log(n))
# -*- coding: utf-8 -*-
"""
Created on Wed May 27 20:52:58 2020
@author: Localuser
"""
def mergesort(x):
copy = list(x)
@accessnash
accessnash / performance_O(n).py
Last active May 25, 2020 18:23
To understand the performance of different functions in terms of O(n)
# -*- coding: utf-8 -*-
"""
Created on Mon May 25 19:22:29 2020
@author: Localuser
"""
from time import time
import random