initial creation

This commit is contained in:
2025-05-20 11:57:43 -04:00
commit c98b612926
8447 changed files with 1862526 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python
"""
@author: jstrick
Created on Wed Mar 20 23:34:17 2013
"""
import csv
import pickle
from collections import namedtuple
fields = 'term firstname lastname birthplace birthstate party'
President = namedtuple('President', fields)
presidents = []
with open('../DATA/presidents.csv') as presidents_in:
rdr = csv.reader(presidents_in)
for row in rdr:
president = President(*row)
presidents.append(president)
p = presidents[15]
print(p.firstname, p.lastname, p.party)
with open('potus.pic','wb') as POTUS:
pickle.dump(presidents,POTUS)