I'm converting a dataframe to dictionary, but the values of one column get an undesired 'L' after the converting. So does anyone know why is it and is there any way to delete this 'L'
I'm tring to use the first 6 columns as the key of the dict and the last column as the value, and here is what I did.
df4=df3.set_index(['ROUTE_NAME','TX_MRKR_ID_FROM','TX_MRKR_OFFSET_FROM',
'TX_MRKR_ID_TO','TX_MRKR_OFFSET_TO','EFF_YEAR'])
df4=df4.to_dict()
However after the conversion all the values under EFF_YEAR get an additional 'L'
and become 2016L, 2000L, and 2001L etc.
I need to iterate through this dictionary and use the keys to find corresponding value in the next step, so could anyone teach me how to delete this undesired 'L'
Thanks a lot
Sincerely
Wilson
Comments
Post a Comment