How data is organized, stored, and manipulated within a program.
Infrastructure(consecutive and non-consecutive Memory stores)>>>operations
- operations
- static >> no change in infrastructure(get or set value)
- Dynamic >> change infrastructure(array resizing)
- 1-Linear Data Structure
- Static Data Structure
- Dynamic Data Structure
- 2-Non-Linear Data Structure
* int: Integer values (e.g., 10, -3).
* float: Floating-point numbers (e.g., 3.14, -0.001).
* complex: Complex numbers (e.g., 1+2j, -3j).
-
- bool: Represents True or False.
-
- str: Sequence of Unicode characters (e.g., "hello", 'python').
- List: Ordered, mutable collection of items (e.g., [1, 2, 3], ['a', 'b', 'c']).
- Tuple: Ordered, immutable collection of items (e.g., (1, 2, 3), ('a', 'b', 'c')).
- Set: Unordered collection of unique items (e.g., {1, 2, 3}, {'a', 'b', 'c'}).
- Dict: Unordered collection of key-value pairs (e.g., {'a': 1, 'b': 2}, {1: 'one', 2: 'two'}).
- None: Represents the absence of a value or a null value.
-
-
Simple (Numbers - Strings)
- Store thier own value
- Stored in memory once
-
Container (Dicts - Lists - User defined Classes)
-
- Reference Count
Automatically release memory when the object takingup that space is no longer in use
Array is not builtin python datastructure but we can implement it by array module
In Python, WE don’t typically work with arrays, but with lists.
There are libraries to work with arrays, but you only use them for certain specialized purposes.
Such as when you need matrix multiplication or some other advanced math, and want to do it quickly.
array base address+single value stores count * index
single value stores count = number of array elements
- Simple Array
- Two dimensional Array
- Multi dimensional Array
- Jagged array[list of lists-in python]
- Import array module
- Declare your variable with Typecode //>> variable_name = array(typecode,[elements])
OR Import numpy
It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices),
and an assortment of routines for fast operations on arrays, including mathematical, logical,
shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations,
random simulation and much more.