Похожие чаты

Hello all, i have a list like this [[a1,v1],[a2,v2]....] how

can iterate in order to get only the vi element of each list?

16 ответов

25 просмотров

For each item in the list read the 2nd element

David-Mills Автор вопроса
Muflone
For each item in the list read the 2nd element

i made this as: for list in external_list: for entry in list: print entry[1] is this right?

David-Mills Автор вопроса
Muflone
No, remove one for loop

that's right, i find out something wrong in my code. Starting from [[a1,v1],[a2,v2]] if i use for item in list: i got each item as [[a1,v1]] instead of a single list, why this happen?

David Mills
that's right, i find out something wrong in my cod...

The second element in item will have your data

David-Mills Автор вопроса
Muflone
The second element in item will have your data

yes but i have a list of list for each item instead of having a single list with 2 values

David-Mills Автор вопроса
Muflone
The item is a list, you told so

i dont get it, sorry. I have something like [[a1,v1],[a2,v2]....] so an external list made of sublists. If i iterate over this external list i should have that each item is a list and i should directly access it. Indeed what i got is that each item is [[a1,v1]] then [[a2,v2]] and so on

David Mills
i dont get it, sorry. I have something like [[a1,v...

This is illogical, your data is not made in the way you refer

posted this in a different group, but this is what you need res = [] for ind in <your list name>: res.append(ind[1]) print(res)

David-Mills Автор вопроса
artemetra 🇺🇦 [less active]
posted this in a different group, but this is what...

the code is right but there is something strange with my data, sorry

David-Mills Автор вопроса
Muflone
This is illogical, your data is not made in the wa...

A=[[1624754860000.0, 251616.928272], [1625356501100.0, 6353738.726276]] this is a part of the list i'm trying to iterate in order to get each second value of each sublist. This is what i got if i made for entry in A: print(entry) [[1624754860000.0, 251616.928272]] [[1625356501100.0, 6353738.726276]]

David Mills
A=[[1624754860000.0, 251616.928272], [16253565011...

the code still works though🧐 it printed out [251616.928272, 6353738.726276]

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта