sort 2d array in python

There are many ways to sort a 2d arrays. In general, you can use the sorted(), np.array.sort(),... But you should also understand what is meaning of list1.sort(list2) ravel() vs. flatten()…

0 Comments

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…

0 Comments

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…

0 Comments

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…

0 Comments