Problem reading csv into frame

User 1869 | 5/2/2015, 10:47:14 PM

I would like to read in weather.csv datafile (from Kaggle), and convert the Date string to a datetime. The column date is unrecognized when I try to do this: weather['datetime'] = weather['Date'].strtodatetime("%Y-%m-%d")

Get error: "RuntimeError: Runtime Exception. Column name Date does not exist."

It does appear to import correctly and shows "Date" as one of the column headers.

Same problem for the training and test data sets. HOWEVER when I removed the addresses from those files, then the conversion to datetime worked as well

From Kaggle West Nile Virus Competition "Station","Date","Tmax","Tmin","Tavg","Depart","DewPoint","WetBulb","Heat","Cool","Sunrise","Sunset","CodeSum","Depth","Water1","SnowFall","PrecipTotal","StnPressure","SeaLevel","ResultSpeed","ResultDir","AvgSpeed" 1,2007-05-01,"83","50","67","14","51","56","0"," 2","0448","1849"," ","0","M","0.0","0.00","29.10","29.82","1.7","27","9.2" 2,2007-05-01,"84","52","68","M","51","57","0"," 3","-","-"," ","M","M","M","0.00","29.18","29.82","2.7","25","9.6" 1,2007-05-02,"59","42","51","-3","42","47","14"," 0","0447","1850","BR","0","M","0.0","0.00","29.38","30.09","13","4","13.4" 2,2007-05-02,"60","43","52","M","42","47","13"," 0","-","-","BR HZ","M","M","M","0.00","29.44","30.08","13.3","2","13.4" 1,2007-05-03,"66","46","56"," 2","40","48","9"," 0","0446","1851"," ","0","M","0.0","0.00","29.39","30.12","11.7","7","11.9" 2,2007-05-03,"67","48","58","M","40","50","7"," 0","-","-","HZ","M","M","M","0.00","29.46","30.12","12.9","6","13.2" 1,2007-05-04,"66","49","58"," 4","41","50","7"," 0","0444","1852","RA","0","M","0.0"," T","29.31","30.05","10.4","8","10.8" 2,2007-05-04,"78","51","M","M","42","50","M","M","-","-"," ","M","M","M","0.00","29.36","30.04","10.1","7","10.4" 1,2007-05-05,"66","53","60"," 5","38","49","5"," 0","0443","1853"," ","0","M","0.0"," T","29.40","30.10","11.7","7","12.0" 2,2007-05-05,"66","54","60","M","39","50","5"," 0","-","-"," ","M","M","M"," T","29.46","30.09","11.2","7","11.5" 1,2007-05-06,"68","49","59"," 4","30","46","6"," 0","0442","1855"," ","0","M","0.0","0.00","29.57","30.29","14.4","11","15.0" 2,2007-05-06,"68","52","60","M","30","46","5"," 0","-","-"," ","M","M","M","0.00","29.62","30.28","13.8","10","14.5" 1,2007-05-07,"83","47","65","10","41","54","0"," 0","0441","1856","RA","0","M","0.0"," T","29.38","30.12","8.6","18","10.5" 2,2007-05-07,"84","50","67","M","39","53","0"," 2","-","-"," ","M","M","M","0.00","29.44","30.12","8.5","17","9.9" 1,2007-05-08,"82","54","68","12","58","62","0"," 3","0439","1857","BR","0","M","0.0","0.00","29.29","30.03","2.7","11","5.8"

Comments

User 91 | 5/4/2015, 5:27:04 PM

Thanks for finding this issue. It looks like the quotes on your SFrame are messing up the readcsv. When I do readcsv, the column "Date" is imported as \"Date\" which can be accessed as

sf["\"Date\""]

This issue has been resolved in the new version (coming very soon)


User 1869 | 5/5/2015, 12:24:27 AM

I simply missed the quoted column names. Thanks!