Skip to content

Instantly share code, notes, and snippets.

View ah89's full-sized avatar
🎯
Focusing

Alireza Heidarikhazaei ah89

🎯
Focusing
View GitHub Profile
@ah89
ah89 / index_correction.py
Created October 3, 2018 10:55
Add index in big csv
import csv
input_file_path = 'soccer_clean_flat.csv'
output_file_name = 'soccer_clean.csv'
f = open(input_file_path)
csv_f = csv.reader(f)
header = csv_f.next()
f2 = open(output_file_name, 'w')
f2.write('{},{},{}\n'.format(header[0], header[1], header[2]))
@ah89
ah89 / greedy_decision_tree.py
Last active July 16, 2018 16:35
greedy and decision tree
import numpy as np
import pandas as pd
import copy
from sklearn import tree
import graphviz
class Greedy:
def __init__(self, set_vlaues, given_tuple, metric):
self.given_tuple = given_tuple
self.set_vlaues = set_vlaues
@ah89
ah89 / csv_flattening.py
Created July 7, 2018 09:08
flatten the the table
import csv
input_file_path = 'ehr_clean.csv'
output_file_name = 'ehr_clean_f.csv'
f = open(input_file_path)
csv_f = csv.reader(f)
rows = []
for row in csv_f: