Plot Histogram in R

Plot Histogram in R: Method 1: hist(vector, breaks) Take care for the parameter "breaks": according the help: breaks: a single number giving the number of cells for the histogram. Important:…

0 Comments

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…

0 Comments

Read an Image with python

If you want to read an image, you will need the 'image' package: import Image read the image: Image.open(filename) convert the Image to grey scale: Image.open(filename).convert('L') convert the image to…

0 Comments