Measure running time a routine in Python

I think this helps us a lot for estimation of how long a program runs in Python. When dealing with a huge amount of data, it takes long time. Showing…

Delete columns in numpy.array

a=array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]]) delete(a, s_[1:3], axis=0) # remove rows 1 and 2 output: array([[…

Select column from a matrix

from operator import itemgetter nested_list = [[1, 2, 3], [10, 20, 30], [100, 200, 300]] map(itemgetter(1), nested_list) Result: [2, 20, 200]   Found it here: http://www.gossamer-threads.com/lists/python/python/770606

Array, List, etc. with String Indices

(Tiếng Việt) Trong lập trình, chúng ta cũng hay gặp nhiều trường hợp phải tạo một danh mục mà index của nó là các chuỗi kí tự. Có một khái niệm để mô tả loại đối tượng này, thường gọi là HashMap hay HashTable.

Counting how many times each string appears in a list

To count how many times a word appearing in a list of words, we can do as follows:

An Introduction to Multiprocessing in Python

Multiprocessing with Python http://toastdriven.com/blog/2008/nov/11/brief-introduction-multiprocessing/

Count the times a word appears in a given string

(Tiếng Việt) Làm thế nào đếm xem một “word” xuất hiện bao nhiêu lần trong một “string” cho trước. Cách đơn giản nhất nhiều người biết: tách chuỗi thành từng từ và so sánh chúng với từ cần tìm.

Tài liệu tham khảo lập trình với Python

Sorry, this entry is only available in Tiếng Việt.

Using Python for scientific and engineering software development

Thực sự nhìn nhận vấn đề, Python được khá nhiều nhà khoa học không chuyên về máy tính sử dụng. Bản thân là người trong nghề, tôi cảm nhận Python…

Python Programming for Beginners

(Tiếng Việt) Để bắt đầu lập trình với Python, bạn nên đọc nhanh bài báo sau được đăng trên tạp chí Linux Python Programming for Beginners. Một số tài nguyên tham khảo có thể giúp học Python như sau: