In many machine learning applications, data handling is done using lists, which are then converted into numpy arrays. This practice can be memory inefficient, especially when dealing with large datasets. Below, I illustrate the problem and provide a solution using numpy pre-allocation.
Let's take an example of data pre-processing with a list:
pre_processed = []