iopro

forcing non-numeric characters to NAs in numpy (when reading a csv to a pandas dataframe)

微笑、不失礼 提交于 2019-12-11 11:33:05
问题 I have records where fields (called INDATUMA and UTDATUMA ) are supposed to comprise numbers in the range of 20010101 and 20141231 (for the obvious reason). To allow missing values but retain precision up to the nearest dates, I would store them as floats (np.float64). I was hoping this would force the occasionally misformatted field (think of 2oo41oo9) to NA s, but instead breaks the import both in pandas 0.18.0 or IOPro 1.7.2. Is there an undocumented option what could use? Or else? The key