Working with Python and Excel

Note: The instructions are for python3.x on Ubuntu

There are several different libraries you can use to easily work with Excel. I will be covering openpyxl. Other options include xlsxwriter, xlrd, xlwt, and xltuils.

Installing openpyxl

To install openpyxl, make sure you have pip3 installed:

which pip3

If pip3 is not installed, install it first:

sudo apt-get install python3-pip

Once pip3 is installed:

Python3 for programmers

This publication is for programmers who want to learn python. It is assumed that you know what variable, arrays, data structures, functions, etc. already are. You only need python's syntax and tips for using them. So here, you will see more code and less explanation. If you are a programmer who only needs to fill in the blanks to become functional in python3, then you have come to the right place. If you need to learn programming, try googling "python for beginners". There are many excellent free online sources to learn python. You don't need to buy a book.

Skills used in Data Science

Not all data scientist are alike. Some do general work while others focus on domains such as health, technology, or business. They can work in predictive analysis, big data, spatial data, or any combination of these. Based on their requirements they require different technical skills.


Following some technology trends that I have observed.

Data Science

A chemist studies chemical properties of objects. A biologist studies living beings. A data scientist studies data. Data is real. It has real properties. Study of data leads to information and knowledge. Answering questions with data leads to revelation, understanding, and wisdom.

Listing all tables and their table counts in a MySQL database

The Following SQL query will list all tables in a MySQL database and also list the row counts for each.

FROM `information_schema`.`tables` 
WHERE `table_schema` = 'mydatabase';

where mydatabase is the name or your database. The output will like something like the following:

| table_name | table_rows |
| lines      |       2271 |
| links      |        484 |
| word       |      25004 |