So I have a data dump that's supposed to represent a person's height. The data is crap and I'm trying to clean it up. Ultimately, I aim to have a separates fields for feet and inches.
Here's what the data looks like now:
Absolutely no validation when people were entering data. My plan is to parse out the first number, feet, and then grab the inches. I've been looking at the data in Python:
The problem is if the string has no spaces as in 5'8", Python reads it as:
I think it's because of the quotes but I cannot figure out how to solve this.
Any ideas?
Here's what the data looks like now:
Code:
5’8”
5’10”
5'8
5'11''
5'7
5'11
6'
5'7''
5'10"
Absolutely no validation when people were entering data. My plan is to parse out the first number, feet, and then grab the inches. I've been looking at the data in Python:
Code:
import csv
reader = csv.reader(open('Height.csv', "rb"), delimiter = ',')
for row in reader:
print row
The problem is if the string has no spaces as in 5'8", Python reads it as:
Code:
5\xe2\x80\x998\xe2\x80\x9d
I think it's because of the quotes but I cannot figure out how to solve this.
Any ideas?