Data manipulation

python

Sort a List

Discover how to sort a list alphabetically in Python using the `sort()` method. This example...

python

Generate List of Even Numbers Using List Comprehension

Learn how to use Python list comprehension to efficiently generate a list of even numbers from a...

python

Create a NumPy 1D Array

Discover how to create a one-dimensional array in Python using NumPy. This simple example...

python

Reshape NumPy Array

Learn how to reshape a one-dimensional array into a matrix using NumPy in Python. This example...

python

Performing Addition and Multiplication on NumPy Arrays

Discover how to use NumPy for array operations in Python. This example covers element-wise...

python

Filtering and Selecting Elements in NumPy Array

Use NumPy’s boolean indexing to filter arrays by conditions and integer indexing to pick...

json python

Append Data to JSON File

This Python script reads a JSON file, appends a new dictionary to the existing data, and writes...