Abstract
Arrays are data structures that store values of the same data type in a contiguous memory area. Thus, arrays are more memory-optimal and perform better than lists but are not supported natively in Python. However, they are supported by the array and numpy modules. In the following, you will look at the processing of data with the help of additional modules and deepen it with the help of exercises.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
1Please remember to install numpy using the pip tool: pip install numpy (on Mac, use pip3 instead of pip).
- 2.
In other languages, multidimensional arrays are often implemented as arrays of arrays and thus do not necessarily have to be rectangular. In Python, this is equally true for nested lists, but not for NumPy arrays, which are always rectangular.
- 3.
While this is always true for NumPy array, this is not always given when simulating an array using nested lists.
- 4.
Therefore, thorough testing and a good selection of test cases are recommended in both cases. How to achieve this is described in my book Der Weg zum Java-Profi [Ind20].
- 5.
In job interviews, you should clarify this by asking a question.
- 6.
Please note that this may vary from system to system.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature
About this chapter
Cite this chapter
Inden, M. (2022). Arrays. In: Python Challenges. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-7398-2_6
Download citation
DOI: https://doi.org/10.1007/978-1-4842-7398-2_6
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-7397-5
Online ISBN: 978-1-4842-7398-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)