+2 votes
in Programming Languages by (12.4k 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

0 votes
by (22k points)

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]

 
...