The p-median model, one of the most widely used location models of any kind,locates p facilities and allocates demand nodes to them to minimize total weighted distance traveled. The P-Median problem will be solved by PuLP package.
The node is based on the package PuLP and here are related tools and references: