-1

This is a sample of a very big list of tuples, i want to create a graph with it but i can't because in many numbers there is a final undesired letter 'L'.

How can i change it or delete it?

my_list=[(2496989087L, [114762303, 4046411357L, 3350679909L, 228860861]),(936533587, [1968901658, 2228506255L, 788861322, 3157824057L])]

I tried in this way (wanted to change 'L' with '0') but it didn't work:

for i in range(len(my_list)):
    if (repr(my_list[i][0])[-1])!=0:
        (repr(my_list[i][0])[-1])=0
    if (repr(my_list[i][1])[-1])!=0:
        (repr(my_list[i][1])[-1])=0
print my_list
Padraic Cunningham
  • 176,452
  • 29
  • 245
  • 321
Alex Punkallo
  • 119
  • 4
  • 16

1 Answers1

0

Just proceed graphing, the L stands for long and will not be a problem.

ennuikiller
  • 46,381
  • 14
  • 112
  • 137
Caridorc
  • 6,222
  • 2
  • 31
  • 46
  • I assumed that L was the problem, in this case i write: 1) graph = nx.Graph() 2) graph.add_edges_from(my_list) and i receive this error: TypeError: unhashable type: 'list' – Alex Punkallo Dec 20 '15 at 21:01