1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| dtypes = { 'ip' : 'uint32', 'app' : 'uint16', 'device' : 'uint16', 'os' : 'uint16', 'channel' : 'uint16', 'is_attributed' : 'uint8', }
dtypes2 = { 'ip' : 'int32', 'app' : 'int16', 'device' : 'int16', 'os' : 'int16', 'channel' : 'int16', 'is_attributed' : 'int8', }
train = pd.read_csv(train_sample_file,parse_dates=['click_time'])
train.info()
train = pd.read_csv(train_sample_file,dtype=dtypes,parse_dates=['click_time'])
train.info()
train = pd.read_csv(train_sample_file,dtype=dtypes2,parse_dates=['click_time'])
train.info()
''' <class 'pandas.core.frame.DataFrame'> RangeIndex: 100000 entries, 0 to 99999 Data columns (total 8 columns): ip 100000 non-null int64 app 100000 non-null int64 device 100000 non-null int64 os 100000 non-null int64 channel 100000 non-null int64 click_time 100000 non-null datetime64[ns] attributed_time 227 non-null object is_attributed 100000 non-null int64 dtypes: datetime64[ns](1), int64(6), object(1) memory usage: 6.1+ MB <class 'pandas.core.frame.DataFrame'> RangeIndex: 100000 entries, 0 to 99999 Data columns (total 8 columns): ip 100000 non-null uint32 app 100000 non-null uint16 device 100000 non-null uint16 os 100000 non-null uint16 channel 100000 non-null uint16 click_time 100000 non-null datetime64[ns] attributed_time 227 non-null object is_attributed 100000 non-null uint8 dtypes: datetime64[ns](1), object(1), uint16(4), uint32(1), uint8(1) memory usage: 2.8+ MB <class 'pandas.core.frame.DataFrame'> RangeIndex: 100000 entries, 0 to 99999 Data columns (total 8 columns): ip 100000 non-null int32 app 100000 non-null int16 device 100000 non-null int16 os 100000 non-null int16 channel 100000 non-null int16 click_time 100000 non-null datetime64[ns] attributed_time 227 non-null object is_attributed 100000 non-null int8 dtypes: datetime64[ns](1), int16(4), int32(1), int8(1), object(1) memory usage: 2.8+ MB '''
|