Ben Chuanlong Du's Blog

It is never too late to learn.

Set in Golang

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

Tips and Traps

Golang does NOT have sets natively. github.com/deckarep/golang-set is a popular 3rd-party set implementation.

Map in Golang

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

Tips and Traps

  1. Please refer to Ordered Map in Golang for discussions on ordered maps in Golang.

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)

Tips on ValeLang

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

My first impression is that Vale is Rust with GC. It looks interesting. However, consider that it is an language which came ealier than Rust but still in alpha stage, I …

Profiling Data Using ydata-profiling

Tips and Traps

  1. It is suggested that you use multiprocessing (e.g., pool_size=8) to speed up data profiling. Note: It seems to me that currently multiprocessing only works when minimal=True.

  2. minimal=True helps reuce consumed memory.

     profile = ProfileReport(
         df, title="Data Profiling Report", 
         explorative=True, minimal=True, pool_size=8
     )