Похожие чаты

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 ответов

16 просмотров

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]

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

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

30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
16
any reference of this implementation?
BitBuddha
29
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Карта сайта