For a detailed look at how this macro was made, as well as some example shapefiles for testing, check out this blog
To support the running of this macro the following python packages must be available:
from ayx import Package
Package.installPackages(['pandas==1.1.0', 'geopandas==0.10.2','Shapely==1.8.2','pyarrow'])