How would you optimize the memory footprint of a large-scale data preprocessing pipeline using Pandas and NumPy?