[PYTHON] What to do if you don't want to use Japanese column names when using ortoolpy.logistics_network

Introduction

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.

Countermeasures

Looking at the declaration part of logistics_netrwork in the source code of ortoolpy, it is written as follows. image.png 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.

Code example

_, 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
                    )

reference

http://pydoc.net/ortoolpy/0.2.10/ortoolpy.etc/

Recommended Posts

What to do if you don't want to use Japanese column names when using ortoolpy.logistics_network
[AWS] What to do when you want to pip with Lambda
What to do if you can't use WiFi on Linux
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
If you want to use field names with hyphens when updating firestore data in python
What to do if you get an Undefined error when trying to use pip with pyenv
What to do if you can't use the trash in Lubuntu 18.04.
Let's summarize what you want to do.
What to do if you get angry if you don't have libxml / xmlversion.h when installing lxml on CentOS
What to do if you can't use scikit grid search in Python
When you want to use it as it is when using it with lambda memo
What to do if you get an error when trying to load mnist
What to do if you get an error when installing Dlib (Ubuntu)
What to do if you can't pipenv shell
What to do if you get a "Wrong Python Platform" warning when using Python with the NetBeans IDE
[Python] What to do if you get a ModuleNotFoundError when importing pandas using Jupyter Notebook in Anaconda
What to do if you get an error when installing python with pyenv
What to do if you get "Python not configured." Using PyDev in Eclipse
What to do when you want to receive files from a Windows client remotely
What to do if you can't pip install mysqlclient
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
If you want to use Cython, also include python-dev
Links to do what you want with Sublime Text
What to do when you can't bind CaboCha to Python
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if you get a memory error when converting from PySparkDataFrame to PandasDataFrame
What to do if you get an error when importing matplotlib in Python (Mac)
How to install and use pyenv, what to do if you can't switch python versions
What to do if you get an Import Error when importing matplotlib with Jupyter
Solution when you want to use cv_bridge with python3 (virtualenv)
What to do if you are addicted to Windows character code
Use aggdraw when you want to draw beautifully with pillow
What to do if you can't sort files with subscripts
What to do if package installation fails when deploying to heroku
What to do if you can't log in as root
When you want to use python2.x on modern Gentoo Linux
If you want your colleagues to use the same language
ImportError: No module What to do when you are told
What to do if you lose your EC2 key pair
Convert DataFrame column names from Japanese to English using Googletrans
I know? Data analysis using Python or things you want to use when you want with numpy
What to do if you get an error when running "certbot renew" in CakePHP environment
What to do when Ubuntu crashes
What to do if yum breaks
Don't write Python if you want to speed it up with Python
What to do if you can't install pyaudio with pip #Python
What to do if you get a minus zero in Python
CommandNotFoundError: Your shell has not been properly configured to use What to do if you get'conda activate'
[Django] What to do if the model you want to create has a large number of fields
[Python] When you want to use all variables in another file
When you want to use multiple versions of the same Python library (virtual environment using venv)
What to do if you get a UnicodeDecodeError with pip install
What to do if Insecure Platform Warning appears when running Python
What to do if you get a must override `get_config` error when trying to model.save in Keras
When you want to send an object with requests using flask
What to do when you get "I can't see the site !!!!"
What to do if you get an error like'Qstring' has already been set to version 1 using mne python
What to do if you get a Permission denied (public key) error when trying to pull on Github
What to do if you can't find well with grep's -f option
What to do if you can't find PDO in Laravel or CakePHP
What to do if you couldn't send an email to Yahoo with Python.