Use openpyxl - read and write Cell in Python

Use openpyxl - read and write Cell in Python

Introduction In previous article, “Use openpyxl - create a new Worksheet, change sheet property in Python”, I introduced how to create a new Worksheet and change Worksheet properties. In this article I show how to read and write Cell in Excel with Python. Enter values to Cell Worksheet object has a position of Cell as property. That is dictionary type and consists of row and column number. Using them, access
Use openpyxl - create a new Worksheet, change sheet property in Python

Use openpyxl - create a new Worksheet, change sheet property in Python

Introduction In previous article, I showed how to create a new Excel file with openpyxl in Python. In this article, I create a new Worksheet, change sheet property Excel files in Python. Environment Runtime environment is as below. python 3.6 openpyxl 2.5.6 Create a new Worksheet Use create_sheet function to add new Worksheet. 1from openpyxl.workbook import Workbook 2 3wb = Workbook() 4 5ws1 = wb.create_sheet("Sheet_A") 6ws1.title = "Title_A" 7 8ws2
Use openpyxl - open, save Excel files in Python

Use openpyxl - open, save Excel files in Python

Introduction In this article I show how to work Excel with openpyxl. Environment Runtime environment is as below. python 3.6 openpyxl 2.5.6 Install Use openpyxl. The openpyxl official document says .. openpyxl is a Python library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files. However, openpyxl can also work with Mac Excel 2016 on my Macbook Pro. Let’s install with pip command. 1pip install openpyxl Create new Excel file Import openpyxl At
Ansible playbook configuration for MySQL8 (how to change root password etc.)

Ansible playbook configuration for MySQL8 (how to change root password etc.)

MySQL major version 8 was released on April 2018. I introduce how to write MySQL 8 ansible playbook. Motivation I usually use AWS. AWS has a database managed service called RDS, and RDS supports MySQL 5.x series. To conduct in-house training using MySQL 8, I needed to make AMI of MySQL 8 with ansible. Environment CentOS 7 Ansible 2.6.1 Packer 1.1.3 Configuration sample of ansible playbook In this case, I describe only the main task definition part in Ansible, I omit Packer configuration because it becomes redundant.
Install Docker to Amazon Linux2

Install Docker to Amazon Linux2

Migration of Amazon Linux to Amazon Linux 2 causes yum install docker command doesn’t work in Amazon Linux 2, so I investigate how to install docker. Motivation Install Docker to Amazon Linux2 without error My Packer build job stopped with error after AWS announced Amazon Linux 2 LTS Candidate in June 2018, because I migrated my server os Amazon Linux to Amazon Linux2. Fail to execute yum install docker and yum search docker command because yum repository has been changed.

Change Soft/Hard limits and file descriptor limits on Amazon Linux 2(systemd)

Motivation When I migrate Amazon Linux to Amazon Linux2, I investigate how to change file descriptor limits and number of process per user on Linux server working with systemd. This post is technical memo for myself. I try the following procedure after booting the official Amazon Linux 2 AMI as it is. Soft limits and Hard limits Let me review what Soft limits and Hard limits are. Linux limits the number of process per user.

Change system clock on Amazon Linux2(systemd)

Motivation When I migrate Amazon Linux to Amazon Linux2, I investigate how to change system clock on Linux server working with systemd. This post is technical memo for myself. Change system clock System clock is calculated by /etc/adjtime that uses hardware clock. If OS working with systemd dosen’t have /etc/adjtime, UTC is default. cat /etc/adjtime > 0.0 0 0.0 > 0 > UTC Now check the system clock with timedatectl command.
Google Colaboratory is the best tool for machine learning engineer

Google Colaboratory is the best tool for machine learning engineer

For engineer who use Jupyter Notebook in often, web IDE named Colaboratory is the best tool. Try Colaboratory. What is Colaboratory? Colaboratory is a web IDE based on Jupyter notebook and hosted by Google. Not only editor, but also runtime is provided by Google, users don’t need to create the environment for development. Everyone can use Colaboratory without Google account, however, links the account, users earn lots of advantages. The good points of Colaboratory Free of charges About usage fee is written in the FAQ.
Convert a string representing the date or epoch time to datetime and change timezone in Python

Convert a string representing the date or epoch time to datetime and change timezone in Python

Motivation Because I always google the way to convert a string representing the date to datetime and change timezone on the Internet, this is note to self article. There are three types to process date and time in Python. datetime, date, and time. I mainly use datetime in this article. Environment python 3.6 pytz jupyter notebook Convert epoch time to datetime Now convert numeric data types of eopch time to datetime.
Add partitions periodically in AWS RDS Aurora Cluster (MySQL compatible) with the SQL Procedures

Add partitions periodically in AWS RDS Aurora Cluster (MySQL compatible) with the SQL Procedures

Introduction RDS Aurora is a managed service provided by AWS. Aurora is a OSS compatible relational database built on cloud. In this article, I explain table partitioning with date in RDS Aurora MySQL compatible. Goals Create table partitioned by date on RDS Aurora (MySQL compatible) Add a partition for a day periodically (once a day) Drop records after a certain period of time Handle errors in these operation running As an example, I handle the following hoge table.