0% found this document useful (0 votes)
4 views5 pages

Comprehensive Python Modules Functions

The document provides a comprehensive reference for various Python modules including Math, Random, Statistics, NumPy, and Pandas. Each module is detailed with functions, their syntax, and descriptions of their purposes. This serves as a quick guide for users to understand and utilize these Python functionalities effectively.

Uploaded by

ayushsharma3069
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Comprehensive Python Modules Functions

The document provides a comprehensive reference for various Python modules including Math, Random, Statistics, NumPy, and Pandas. Each module is detailed with functions, their syntax, and descriptions of their purposes. This serves as a quick guide for users to understand and utilize these Python functionalities effectively.

Uploaded by

ayushsharma3069
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Comprehensive Python Modules Functions

Reference

Math Module

Function Syntax Description


ceil() [Link](x) Round up
floor() [Link](x) Round down
sqrt() [Link](x) Square root
pow() [Link](x,y) Power function
exp() [Link](x) e^x
log() [Link](x, base) Logarithm
log10() math.log10(x) Base 10 log
log2() math.log2(x) Base 2 log
factorial() [Link](x) Factorial
gcd() [Link](a,b) Greatest common divisor
sin() [Link](x) Sine (radians)
cos() [Link](x) Cosine (radians)
tan() [Link](x) Tangent (radians)
degrees() [Link](x) Radians to degrees
radians() [Link](x) Degrees to radians
fabs() [Link](x) Absolute value
isqrt() [Link](x) Integer square root
Random Module

Function Syntax Description


random() [Link]() Random float (0-1)
randint() [Link](a,b) Random integer
randrange() [Link](start,stop) Random from range
choice() [Link](seq) Random element
choices() [Link](seq,k=n) Multiple random elements
shuffle() [Link](seq) Shuffle list
sample() [Link](seq,k) Random sample
uniform() [Link](a,b) Random float range
seed() [Link](x) Seed generator
Statistics Module

Function Syntax Description


mean() [Link](data) Arithmetic mean
median() [Link](data) Median
mode() [Link](data) Mode
stdev() [Link](data) Standard deviation
variance() [Link](data) Variance
pstdev() [Link](data) Population std dev
pvariance() [Link](data) Population variance
harmonic_mean() statistics.harmonic_mean(data) Harmonic mean
multimode() [Link](data) Multiple modes
NumPy Module

Function Syntax Description


array() [Link](obj) Create array
zeros() [Link](shape) Array of zeros
ones() [Link](shape) Array of ones
arange() [Link](start,stop,step) Range array
linspace() [Link](start,stop,num) Evenly spaced values
reshape() [Link](arr,shape) Reshape array
mean() [Link](arr) Mean
median() [Link](arr) Median
std() [Link](arr) Standard deviation
sum() [Link](arr) Sum of elements
min() [Link](arr) Minimum
max() [Link](arr) Maximum
dot() [Link](a,b) Dot product
transpose() [Link](arr) Transpose
[Link]() [Link]() Random array
Pandas Module

Function Syntax Description


DataFrame() [Link](data) Create DataFrame
Series() [Link](data) Create Series
read_csv() pd.read_csv(file) Read CSV
read_excel() pd.read_excel(file) Read Excel
head() [Link]() First rows
tail() [Link]() Last rows
info() [Link]() Data info
describe() [Link]() Stat summary
loc[] [Link][row,col] Label-based selection
iloc[] [Link][row,col] Index-based selection
groupby() [Link](col) Group data
merge() [Link](df1,df2) Merge DataFrames
concat() [Link]([df1,df2]) Concatenate
drop() [Link](col) Drop column
fillna() [Link](val) Fill missing values

You might also like