In doing "Python practice data analysis 100 knocks", there was a content to use the function called logistics_network in the module called ortoolpy.
It is a function that can be used for things like optimizing production plans, but if you follow the movement, it is the default to use Japanese such as "factory" for the column name of the DataFrame given as an argument.
However, I sometimes find it a little unpleasant to use Japanese for column names.
At that time, I thought about what to do.
Looking at the declaration part of logistics_netrwork in the source code of ortoolpy, it is written as follows. If you look at this, you can see that column names such as "demand" and "factory" are specified by the default argument of the logistics_network function. So, for example, in the case of "demand area", if you execute logistics_network with the argument `` `dep```, you can execute it without using the column name in Japanese called "demand area". I will.
_, tbdi2, _ = logistics_network(
tbde, tbdi, tbfa,
dep = "demand_place", #Demand area
dem = "demand" , #demand
fac = "factory", #factory
prd = "product", #Product
tcs = "trans_cost", #Shipping costs
pcs = "product_cost", #Production cost
lwb = "lower_limit", #lower limit
upb = "upper_limit" #upper limit
)
http://pydoc.net/ortoolpy/0.2.10/ortoolpy.etc/
Recommended Posts