Skip to content

Commit

Permalink
Trying mode='rt'
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 20, 2015
1 parent e3e3d0b commit fc76e87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions panoramix/bin/panoramix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import csv
from datetime import datetime
import gzip
import json
import os
from subprocess import Popen

from flask.ext.script import Manager
Expand Down Expand Up @@ -79,9 +80,8 @@ def load_examples(sample):

BirthNames.create(db.engine)
session = db.session()
with gzip.open(
config.get("BASE_DIR") + '/data/birth_names.csv.gz',
encoding="ascii") as f:
filepath = os.path.join(config.get("BASE_DIR"), 'data/birth_names.csv.gz')
with gzip.open(filepath, mode='rt') as f:
bb_csv = csv.reader(f)
for i, (state, year, name, gender, num) in enumerate(bb_csv):
if i == 0 or year < "1965": # jumpy data before 1965
Expand Down

0 comments on commit fc76e87

Please sign in to comment.