Instantly share code, notes, and snippets.

Embed
What would you like to do?
import csv
with open("Meteorite_Landings.csv","rb") as source:
rdr= csv.reader(source)
with open("results.csv","wb") as result:
wtr= csv.writer( result )
for r in rdr:
del r[-3:]
del r[:4]
del r[-2]
wtr.writerow( r )
with open("results.csv","rb") as source:
rdr = csv.reader(source)
with open("minimeteor.csv","wb") as result:
wtr = csv.writer(result)
next(rdr, None)
wtr.writerow(['year', 'mass'])
for r in rdr:
str0 = ''.join(r)
str1 = str0[-16:]
str1 = str1[:4]
str2 = str0[:-22]
input = [str1, str2]
wtr.writerow(input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment