List vs Array | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

List vs Array

Between list and array which consumes memory the most in python?

28th Sep 2019, 3:51 PM
Fredrick
Fredrick - avatar
5 ответов
+ 3
Definitely lists because they have way more overhead.
28th Sep 2019, 4:49 PM
Thoq!
Thoq! - avatar
+ 2
Naturally lists require more memory, because they can store different types of values and list size can be changed after creation. But depends which arrays and lists you are comparing. array of numpy or array of array?
28th Sep 2019, 5:14 PM
Seb TheS
Seb TheS - avatar
28th Sep 2019, 10:18 PM
Seb TheS
Seb TheS - avatar
0
The array module.
28th Sep 2019, 8:11 PM
Fredrick
Fredrick - avatar
0
Sizes in bytes: As empty: list: 20 tuple: 12 array: 32 With integers from 0 to 9: list: 88 tuple: 52 array: 48
28th Sep 2019, 8:26 PM
Seb TheS
Seb TheS - avatar