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…

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…

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 =””” { “result”: [{“short_description”: “I am getting bluescreen…

Animating a point walking flow with python

Using the SimpleGUICS2Pygame can animate the walking path easily. (The SimpleGUICS2Pygame is a implementation of simplegui.) I wrote an small code for the simulation in codeskulptor, you can run it directly and see the effect: But you need to install and…

solution for installing pygame

I have two computers, the one has windows system at home, the other has ubuntu system in my office. In each computer, I have two python, the one is normal python, the other is anaconda. I try to install the…

matrix calculation in R and Python

Useful packages: R: library(matrixcalc) Python: numpy Matrix generation: R: matrix(1:6, 2, 3) Python: np.arange(1,7).reshape(2,3) construct a diagnal matrix: R: advanced-R diag(vector, nrow, ncol) #construct a matrix which diagonal elements is equal to the vector diag(matrix) # a vector which elements is…