the crazy * in zip()

I just want to reshape the List without use the numpy, so I found a piece of crazy code in stackoverflow: output: [(‘a’, ‘b’), (‘c’, ‘d’), (‘e’, ‘f’)] After the long consideration, I understand the code at last. The python…

the asterik * in python

Asterik in python is usually very confused for the beginner.  Some times it appears one time before a variable like *args, some times it appears two times like **args. Usually it appears in function definition: * and ** allow arbitrary…

normalize vectors

In data mining tasks is the attributes normalizing usually a prerequisite in order to get a meaningful result. For example, if you want to calculate the euclidean distance, the attributes with relative large numerical values will have more influence of…

Vector calculation in python and in R

There are different ways doing math for vector in python 1. use loop 2. use loop, but in list 3. use numpy 4. use map and lambda functions In R language, the vector math is relative easy Alternative for creating the…