Skip to content

Instantly share code, notes, and snippets.

View shak360's full-sized avatar
🧸

Shakthi Visagan shak360

🧸
View GitHub Profile
import numpy as np
from itertools import chain
def gmm_2d_data_maker(pi_list_of_mixing_weights,
mu_list_of_vectors_means,
R_list_of_arrays_covs,
N_number_of_samples):
"""
Creates a two dimensional list of points about N_number_of_samples long
with labels.
states = {
"AK": "O",
"AL": "S",
"AR": "S",
"AS": "O",
"AZ": "W",
"CA": "W",
"CO": "W",
"CT": "N",
"DC": "N",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import matplotlib.pyplot as pl
import numpy as n
def F(i):
m=i
j=2
while j<=i/j:
if i%j==0:
m=j
i/=j
@shak360
shak360 / linear_reg2_zillow.py
Created August 9, 2017 01:51
Linear Regression in 2 Variables Python
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
plt.style.use('bmh')
df = pd.read_csv('zillow.csv') # from http://people.sc.fsu.edu/~jburkardt/data/csv/ load into a dataframe
column_list = ['index', 'Living Space (square footage)', 'beds', 'baths', 'zip', 'year', 'Home Price (USD)'] # not a fan of the current header column, will change to my own labels
# Create a program that asks the user to enter their name and their age.
# Print out a message addressed to them that tells them the year
# that they will turn 100 years old.
# Add on to the previous program by asking the user for another number
# and printing out that many copies of the previous message.
# Print out that many copies of the previous message on separate lines.
# (Hint: the string "\n is the same as pressing the ENTER button)
import datetime