Skip to content

Commit

Permalink
hhh
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavynest committed Apr 1, 2019
1 parent 98e3ef1 commit e0812cf
Show file tree
Hide file tree
Showing 3 changed files with 992 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bodyparts and causes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
humanbody={'ligament', 'hand', 'footheel', 'knee', 'nose', 'rib', 'orbital', 'tooth', 'pulmonary', 'facial', 'knee',
'Acchilles', 'muscle', 'handthumb', 'calf', 'atrial', 'heart', 'handfinger', 'back', 'arm', 'neck', 'ankle',
'lung', 'thigh', 'leg', 'tibia', 'elbow', 'tonsils', 'appendectomy', 'jaw', 'shoulder', 'groin', 'hamstring',
'hip', 'tendon', 'appendix', 'bicep', 'hernia', 'head', 'wrist', 'concussion', 'finger', 'foot', 'spinal', 'shin',
'quadricep', 'kneecap', 'rotator', 'eye', 'chest', 'testicle', 'quadricep', 'face', 'abdomen', 'air', 'toe',
'heel', 'fibula', 'Achilles', 'thumb', 'cheekbone','air pocket'}

causes={'sprained', 'sore', 'strained', 'broken','blood clot','surgery','fracture','torn','injury','bruise','dislocate',
'hyperextended','rupture','tendinitis','scar','herniated disc','damage','nerve','separated','bursitis','plantar fasci','stress reaction',
'spasm','swelling','subluxation','enlarged'}
1 change: 1 addition & 0 deletions category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import csvimport stringfrom collections import defaultdictcsv_file = csv.reader(open("injuries.csv",'r'))player_date=defaultdict(list)next(csv_file)humanbody={'ligament', 'hand', 'footheel', 'knee', 'nose', 'rib', 'orbital', 'tooth', 'pulmonary', 'facial', 'knee', 'Acchilles', 'muscle', 'handthumb', 'calf', 'atrial', 'heart', 'handfinger', 'back', 'arm', 'neck', 'ankle', 'lung', 'thigh', 'leg', 'tibia', 'elbow', 'tonsils', 'appendectomy', 'jaw', 'shoulder', 'groin', 'hamstring', 'hip', 'tendon', 'appendix', 'bicep', 'hernia', 'head', 'wrist', 'concussion', 'finger', 'foot', 'spinal', 'shin', 'quadricep', 'kneecap', 'rotator', 'eye', 'chest', 'testicle', 'quadricep', 'face', 'abdomen', 'toe', 'heel', 'fibula', 'Achilles', 'thumb', 'cheekbone','air pocket'}causes={'sprained', 'sore', 'strained', 'broken','blood clot','surgery','fracture','torn','injury','bruise','dislocate', 'hyperextended','rupture','tendinitis','scar','herniated disc','damage','nerve','separated','bursitis','plantar fasci','stress reaction', 'spasm','swelling','subluxation','enlarged'}for line in csv_file: #notes=line[4].translate(str.maketrans('', '', string.punctuation)) flag=False #notes=notes.split() ig=0 if ('DTD' not in line[4]) and ('DNP' not in line[4]) and ('returned to lineup' not in line[4]) and ('rest' not in line[4]) and ('illness' not in line[4]) and ('coach' not in line[4]): for bodypart in humanbody: if bodypart in line[4]: player_date[line[3]].append(line[0]) flag=True break # if not flag: # print(line[4])csv_file = csv.reader(open("injuries.csv",'r'))next(csv_file)f=open('DataBase.csv','w')fuck=csv.writer(f,delimiter=',',quotechar='"',lineterminator='\n')for line in csv_file: #notes=line[4].translate(str.maketrans('', '', string.punctuation)) flag=False writeflag=False #notes=notes.split() ig=0 notes=line[4] line[4]="" line.append('') if ('DTD' not in notes) and ('DNP' not in notes) and ('returned to lineup' not in notes) and ('rest' not in notes) and ('illness' not in notes): for bodypart in humanbody: if bodypart in notes: line[4]+=bodypart line[4]+='/' for cause in causes: if cause in notes: line[5]+=cause line[5]+='/' fuck.writerow(line)
Expand Down
Loading

0 comments on commit e0812cf

Please sign in to comment.