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…
Category: Python
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
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.
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:
