-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
BugIO CSVread_csv, to_csvread_csv, to_csvIO DataIO issues that don't fit into a more specific labelIO issues that don't fit into a more specific label
Description
Poster has an example which tricks read_csv into thinking column a is a int, but then throws it lots of strings (and it then infers 1s as strings).
import pandas as pd
df = pd.DataFrame({'a':['1']*100000 + ['X']*100000 + ['1']*100000, 'b':['b']*300000})
df.to_csv('test', sep='\t', index=False, na_rep='NA')
df2 = pd.read_csv('test', sep='\t')
print df2['a'].unique()
http://stackoverflow.com/questions/18471859/pandas-read-csv-dtype-inference-issue
I think this is rather an edge case tbh. :)
Metadata
Metadata
Assignees
Labels
BugIO CSVread_csv, to_csvread_csv, to_csvIO DataIO issues that don't fit into a more specific labelIO issues that don't fit into a more specific label