I am working with a dataset of 4.2 millions points and my codes is already taking a while to process, however below code is taking several hours to process (the code