Hướng dẫn Python

TRANG CHỦ Python Giới thiệu Python Python Bắt đầu Cú pháp Python Nhận xét Python Biến Python Các kiểu dữ liệu Python Số Python Đúc Python Chuỗi Python Python Booleans Toán tử Python Danh sách Python Python Tuples Bộ Python Từ điển Python Python Nếu ... Khác Python While Loops Python cho các vòng lặp Các hàm Python Python Lambda Mảng Python Các lớp / đối tượng Python Kế thừa Python Trình lặp lại Python Phạm vi Python Mô-đun Python Ngày trong Python Toán Python JSON Python Python RegEx Python PIP Python Thử ... Ngoại trừ Đầu vào của người dùng Python Định dạng chuỗi Python

Xử lý tập tin

Xử lý tệp Python Tệp đọc Python Viết / tạo tệp trong Python Xóa tệp trong Python

Mô-đun Python

Hướng dẫn NumPy Panda Walkthrough Hướng dẫn Scipy

Python Matplotlib

Giới thiệu Matplotlib Matplotlib Bắt đầu Matplotlib Pyplot Matplotlib Plotting Điểm đánh dấu Matplotlib Dòng Matplotlib Nhãn Matplotlib Matplotlib Grid Matplotlib Subplots Matplotlib Scatter Matplotlib Bars Biểu đồ Matplotlib Biểu đồ bánh Matplotlib

Học máy

Bắt đầu Chế độ trung bình trung bình Độ lệch chuẩn Phân vị Phân phối dữ liệu Phân phối dữ liệu bình thường Lô phân tán Hồi quy tuyến tính Hồi quy đa thức Nhiều hồi quy Tỉ lệ Huấn luyện / Kiểm tra Cây quyết định

Python MySQL

MySQL Bắt đầu MySQL Tạo cơ sở dữ liệu MySQL Tạo bảng Chèn MySQL Lựa chọn MySQL MySQL ở đâu MySQL Đặt hàng bởi MySQL Delete Bảng thả MySQL Cập nhật MySQL Giới hạn MySQL Tham gia MySQL

Python MongoDB

MongoDB Bắt đầu MongoDB Tạo cơ sở dữ liệu MongoDB Tạo Bộ sưu tập Chèn MongoDB MongoDB Tìm Truy vấn MongoDB MongoDB sắp xếp MongoDB Xóa MongoDB Drop Collection Cập nhật MongoDB Giới hạn MongoDB

Tham khảo Python

Tổng quan về Python Các hàm tích hợp trong Python Phương thức chuỗi Python Phương thức danh sách Python Phương thức từ điển Python Phương thức Tuple trong Python Phương thức tập hợp Python Phương thức tệp Python Từ khóa Python Ngoại lệ Python Bảng chú giải thuật ngữ Python

Tham chiếu mô-đun

Mô-đun ngẫu nhiên Mô-đun yêu cầu Mô-đun thống kê Mô-đun Toán học Mô-đun cMath

Python Làm thế nào để

Xóa danh sách trùng lặp Đảo ngược một chuỗi Thêm hai số

Ví dụ Python

Ví dụ Python Trình biên dịch Python Bài tập Python Python Quiz Chứng chỉ Python

Mô-đun ngẫu nhiên Python


Python có một mô-đun tích hợp mà bạn có thể sử dụng để tạo các số ngẫu nhiên.

random-đun có một tập hợp các phương pháp:

Method Description
seed() Initialize the random number generator
getstate() Returns the current internal state of the random number generator
setstate() Restores the internal state of the random number generator
getrandbits() Returns a number representing the random bits
randrange() Returns a random number between the given range
randint() Returns a random number between the given range
choice() Returns a random element from the given sequence
choices() Returns a list with a random selection from the given sequence
shuffle() Takes a sequence and returns the sequence in a random order
sample() Returns a given sample of a sequence
random() Returns a random float number between 0 and 1
uniform() Returns a random float number between two given parameters
triangular() Returns a random float number between two given parameters, you can also set a mode parameter to specify the midpoint between the two other parameters
betavariate() Returns a random float number between 0 and 1 based on the Beta distribution (used in statistics)
expovariate() Returns a random float number based on the Exponential distribution (used in statistics)
gammavariate() Returns a random float number based on the Gamma distribution (used in statistics)
gauss() Returns a random float number based on the Gaussian distribution (used in probability theories)
lognormvariate() Returns a random float number based on a log-normal distribution (used in probability theories)
normalvariate() Returns a random float number based on the normal distribution (used in probability theories)
vonmisesvariate() Returns a random float number based on the von Mises distribution (used in directional statistics)
paretovariate() Returns a random float number based on the Pareto distribution (used in probability theories)
weibullvariate() Returns a random float number based on the Weibull distribution (used in statistics)