I am new to pandas and I thought it would be a good idea to give it a spin but as so often the first time appears to be not so easy.
I basically tried the following: Pandas read in table without headers
And I get the following error (unfortunately Usecols do not match names does not ring a bell since I set header to None):
ValueError: Usecols do not match names.
here is my code:
import numpy as np
DATA_FOLDER = 'season_1/training_data/'
#data = np.loadtxt(DATA_FOLDER + 'order_data/order_data_sample',
# dtype={'names': ('order_id', 'driver_id', 'passenger_id', 'start_district_hash',
# 'dest_distric_hash', 'price', 'time'),
#... 'formats': ('S32', 'S32', 'S32', 'S32', 'S32', 'f6', 'f4')})
import pandas as pd
df = pd.read_csv(DATA_FOLDER + 'order_data/order_data_sample', parse_dates=[6], header=None, usecols=[3, 4, 6])
df
and my data:
97ebd0c6680f7c0535dbfdead6e51b4b dd65fa250fca2833a3a8c16d2cf0457c ed180d7daf639d936f1aeae4f7fb482f 4725c39a5e5f4c188d382da3910b3f3f 3e12208dd0be281c92a6ab57d9a6fb32 24 2016-01-01 13:37:23
92c3ac9251cc9b5aab90b114a1e363be c077e0297639edcb1df6189e8cda2c3d 191a180f0a262aff3267775c4fac8972 82cc4851f9e4faa4e54309f8bb73fd7c b05379ac3f9b7d99370d443cfd5dcc28 2 2016-01-01 09:47:54
abeefc3e2aec952468e2fd42a1649640 86dbc1b68de435957c61b5a523854b69 7029e813bb3de8cc73a8615e2785070c fff4e8465d1e12621bc361276b6217cf fff4e8465d1e12621bc361276b6217cf 9 2016-01-01 18:24:02
cb31d0be64cda3cc66b46617bf49a05c 4fadfa6eeaa694742de036dddf02b0c4 21dc133ac68e4c07803d1c2f48988a83 4b7f6f4e2bf237b6cc58f57142bea5c0 4b7f6f4e2bf237b6cc58f57142bea5c0 11 2016-01-01 22:13:27
139d492189ae5a933122c098f63252b3 NULL 26963cc76da2d8450d8f23fc357db987 fc34648599753c9e74ab238e9a4a07ad 87285a66236346350541b8815c5fae94 4 2016-01-01 17:00:06
I hope I have used the right tags for this...