+2 votes
in Programming Languages by (73.8k points)
I created a list using Pandas module, however, all the elements of the list have "L". How can I remove "L" from all the elements in the list?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

The L denotes type 'long'. The elements in the list are long integers.

If all the values are of type 'long', you can use map() function to convert to integer. Check the following example.

>>> aa=[2l,3l,4l]

>>> aa

[2L, 3L, 4L]

>>> aa_int=map(int,aa)

>>> aa_int

[2, 3, 4]

 

...