People always forget how long can they live, so, they plan everything for forever.

End of the world is actually the day end of your life.

Please enjoy every day and every moment.

Without you, the world is meaningless.

and keep in mind, how many decades, you can still live.

Life consists of endless moments, not future.

Meditation: Concentrate on the moment, and plan the next action not more than 7 seconds far away.

In the world,

nothing is important, even your life,

nothing has meaning, even your life,

so, you can do everything whatever you like,

no decision is wrong, no decision is right,

no decision is right,

every decision is made by the history.

After 100 years, everything will turn to meaningless.

since all of us will die before this time.

Don’t try to be normal,

no one is normal,

if you try to pretend normal,

no one will pay attention to you,

because you are normal.




the most useful pycharm hotkey

ctrl + s : save all

ctrl + y : delete row

ctrl + b / ctrl + click: go to the source



The useful python libraries

contextlib.py : can include the object in “with” and keep the memory small.

py4j: call java from python


Python vs. R

It is very difficult to say which one I like more.

Jupter vs. RMarkdown

  • RMarkDown: quick edit for beautiful report, compile is slow
  • Jupyter: console in web, flexible, but sometimes you will fall into chaos
  • Both can integrate different language


  • Python > R


  • R has more users in no computer science community

Time Series:

  • R has very good tutorials and packages for time series.

Image processing:

  • Since Python is faster than R, Python is more suitable for image processing


  • R: dplyr
  • Python: pandas


Master the two languages, your will find many friends. 🙂


Install Jupyter Kernel

1. How to install ipython 3 kernel to jupyter?
+ install Anaconda 3
+ copy “Jupyter notebook” symbol to desktop
+ right click -> “property” -> “start in” change to the folder which you want to begin with

2. How to install IRKernel to Jupyter?
+ Open Anaconda 3 prompt
+ conda install -c r r-essentials
+ https://www.continuum.io/blog/developer/jupyter-and-conda-r


compare two lists

It is very easy to compare two lists in python, but it seems not so many people know it.

Just use the `==` symbol in numpy, it will return a numpy array with boolean value, True means the position are idential.

import numpy as np

aa = [“a”,”b”,”a”]
bb = [“b”,”b”,”a”]


>>array([False, True, True], dtype=bool)

see my example code in stackoverflow:



break the long line in python

There are several methods to break the long string line in python. I think the triple-quoted “”” method is the easiest way. The reason is you can also for json object.

myJson =””” {
[{“short_description”: “I am getting bluescreen error”,
“sys_id”: “39b5f8c2376ede007520021a54990e5c”,
“opened_at”: “2016-04-04 05:19:53”,
“short_description”: “laptop crashed with a blue screen”,
“sys_id”: “da0095380f43d200a4f941fce1050eeb”,
“opened_at”:”2016-04-25 06:33:52″,
“short_description”: “Laptop not booting”,
“sys_id”: “ecf9c9b00f43d200a4f941fce1050e17”,
“opened_at”: “2016-04-25 06:07:16”,
“number”: “INC0259061”
data = json.loads(myJson)

It works!


hide messages in RMD

If you write Rmd file, the messages are always very disturbing. There are two methods to avoid it:

1. Global method
{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)

2. Local method


An Overview of Outlier Detection Techniques and Applications

Yesterday, I did the presentation in Machine Learning Rhein-Neckar Meetup.  It is so nice to meet people with the same loving in data mining.  The following is my presentation. The short version I used for the presentation and the long version with the notation is for myself.


change R version

link is from


default R adress: $which R


it can be

Force R Studio use the specific version:

export RSTUDIO_WHICH_R=/usr/local/bin/R