Ben Chuanlong Du's Blog

It is never too late to learn.

SQL Database Client-server Protocols

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Apache Arrow Flight is the future protocol for querying Databases! It use columnar data and leverages Apache Arrow to avoid unnecessary copy of data, which makes it able to query large …

No BLAS or LAPACK Found When Installing Scipy

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

To build Scipy from sources, BLAS & LAPACK libraries need to be installed. See site.cfg.example in the Scipy source directory and

sudo apt-get install gfortran libopenblas-dev liblapack-dev

The dependency requires …

Bash Equivalent of the ifmain Pattern in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

#!/usr/bin/env bash

function install_icon.usage() {
    cat << EOF
NAME
    /scripts/sys/install_icon.sh - Download and install icon to /usr/local/bin/.
SYNTAX 
    /scripts/sys/install_icon.sh [-h]
EOF
}

function install_icon …

Cast Types of Columns in Pandas

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. You can use the method Series.astype to cast the type of a series.

  2. Series.astype(str) converts NaNs to the string literal nan. This is often NOT what people want. A better way is to use Series.astype(object)