0% found this document useful (0 votes)
26 views

Pandas Function

Uploaded by

akash.s.vc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Pandas Function

Uploaded by

akash.s.vc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Pandas Function

-Official Link
-Study Guide

It is used to read data from variety of source


we can do all sorts (Process,visualize, wrangle)

Download for future use

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Element-wise addition between dataframe and series
add() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.a
dd.html

Povides the count of non-null values


count() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.co
unt.html

Resample time-series data to a specified frequency, allowing for


adjustments and filling of missing values.
asfreq()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.as
freq.html

Calculate the correlation coefficients between columns


corr() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.co
rr.html

Calculate the autocorrelation of a time series


autocorr() https://pandas.pydata.org/docs/reference/api/pandas.Series.autoco
rr.html

Covariance between columns


cov() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.co
v.html

Calculates the cumulative sum of elements


cumsum() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.cu
msum.html

Element-wise division between two DataFrames or Series


div() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.di
v.html

Element-wise respective reverse operations division


rdiv() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rd
iv.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Returns the index of the first occurrence of the minimum value
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.idxmi
idxmin()
n.html

Find the maximum value


https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.max.
max()
html

Returns the index of the first occurrence of the maximum value


idxmax() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.idxm
ax.html

Element-wise respective reverse operations addition


radd() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.radd.
html

Element-wise subtraction
sub() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sub.h
tml

Element-wise respective reverse operations subtraction


rsub() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rsub.
html

Element-wise multiplication
mul() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.mul.h
tml

Element-wise respective reverse operations multiplication


rmul() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rmul.
html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Calculates the minimum value
min() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.mi
n.html

Element-wise exponentiation
pow() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.po
w.html

Element-wise respective reverse operations exponentiation,


rpow() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rpo
w.html

Statistical summary of the central tendency, dispersion, and shape of the


distribution for numeric columns in a DataFrame.
describe()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.de
scribe.html

Used to count the occurrences of unique values in a Series, providing a


quick summary of the distribution of values.
Value_count
https://pandas.pydata.org/pandas-
docs/stable/reference/api/pandas.Series.value_counts.html

Calculates the skewness


skew() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sk
ew.html

Calculates the variance


var() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.var
.html

Calculates the standard deviation


std() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std
.html

sort Sort a DataFrame or Series in ascending or descending order

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Sort index in either ascending or descending order
sort_index() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.s
ort_index.html

Facilitating ascending or descending order arrangement for data


analysis.
sort_values()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.s
ort_values.html

Assigns ranks to elements in a Series or DataFrame, indicating their


relative positions based on values with ties receiving average ranks.
rank()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.r
ank.html

If any element along a specified axis


any() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.a
ny.html

Checks if all elements along a specified axis


all() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.a
ll.html

Axis of a DataFrame or Series, allowing for transformation and


computation on the elements.
apply()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.a
pply.html

Method that retrieves the first n rows of a DataFrame or Series


head() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.h
ead.html

Summary of a DataFrame
info() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.i
nfo.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Retrieves the last n rows
tail() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.tail.
html

Attribute that provides the dimensions (number of rows and columns)


shape() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sha
pe.html

Attribute used to retrieve the data type


dtype() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dty
pes.html

Allows explicit conversion of the data type


astype() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ast
ype.html

column labels
columns() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.col
umns.html

Convert all the strings in a Series or DataFrame to uppercase


upper() https://pandas.pydata.org/docs/reference/api/pandas.Series.str.upper
.html

Convert all the strings in a Series or DataFrame to lowercase.


lower() https://pandas.pydata.org/docs/reference/api/pandas.Series.str.lower
.html

Retrieve the unique values


unique()
https://pandas.pydata.org/docs/reference/api/pandas.unique.html

Number of unique (distinct) values


nunique() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.nun
ique.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Group a DataFrame by one or more columns, enabling the application of
aggregate functions, transformations, or other operations within each
groupby() group.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.gr
oupby.html

Integer-location based indexing method


iloc() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ilo
c.html

Label-based indexing method, both used to access specific elements or


slices
loc()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.lo
c.html

Omit rows or columns from a Pandas DataFrame


drop() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dr
op.html

Eliminates duplicate rows from a DataFrame, retaining only the first


drop_duplica occurrence of each unique row
te() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dr
op_duplicates.html

Removes rows with missing values (NaN) from a DataFrame.


dropna() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dr
opna.html

Used to replace specified values with other values in a DataFrame or


Series, facilitating data cleaning and transformation
replace()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.re
place.html

Pad the left side of a string representation of a number with zeros to


achieve a specified width.
zfill()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.zfill.
html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Fill NaN values in the DataFrame by propagating the last valid observation
forward along each column
ffill()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ffill.
html

Replace NaN (missing) values in a DataFrame with a specified value or


using various filling methods, such as forward-fill
fillna
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.filln
a.html

Utilized to subset a DataFrame based on specified criteria, such as column


labels, regex patterns, or items.
filter()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.filte
r.html

Rename a column
rename() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ren
ame.html

Fill missing values in a DataFrame by backward-filling, which means


propagating the next valid observation backward along each column.
bfill()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.bfill.
html

Change the frequency of time-series data, allowing for aggregation or


resample( downsampling by specifying a new time frequency.
) https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.resa
mple.html

Repetition of elements in a Series or DataFrame by specifying the number


of times each element should be repeated.
repeat()
https://pandas.pydata.org/docs/reference/api/pandas.Series.repeat.ht
ml

Concatenate Pandas DataFrames along a specified axis, enabling the


cat() combination of data along either rows or columns.
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Append new categories to an existing categorical column within a
cat.add_
DataFrame
categorie
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.add_ca
s()
tegories.html

Retrieve the unique categories present in that categorical column.


cat.categ
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.categor
ories()
ies.html

Convert a categorical column to an ordered categorical column, allowing for


cat.as_or meaningful sorting based on the order of categories.
dered() https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.as_ord
ered.html

Attribute of a categorical column in Pandas returns an array of integer codes


representing the categories of that categorical column
cat.codes
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.codes.h
tml

Attribute of a categorical column in Pandas is used to determine if the


categories have a meaningful ordering, returning True if they are ordered
cat.order
and False otherwise.
ed
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.ordered
.html

Exclude specified categories from a categorical column, providing a way to


cat.remo
filter or reduce the categories in the column.
ve_categ
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.remove
ories()
_categories.html

Removes categories from a categorical column that are not currently


cat.remo
present in the data, optimizing memory usage by eliminating unused
ve_unus
categories.
ed_categ
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.remove
ories()
_unused_categories.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Allows for the renaming of categories in a categorical column, enabling the
cat.renam
modification of labels associated with different categories.
e_categor
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.rename
ies()
_categories.html

Assign a new set of categories to a categorical column, allowing you to


cat.set_c update or redefine the categories associated with the column.
ategories https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.set_cate
gories.html

Extends the categories of a Categorical data type in a Series or DataFrame by


cat.add_c
adding new categories
ategories(
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.add_cat
)
egories.html

Applying multiple aggregation functions simultaneously on DataFrame


columns, facilitating the computation of summary statistics.
agg()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.agg.ht
ml

groupby() method,(as_index=True) or be kept as regular columns


as_index
(as_index=False)

Creates a new DataFrame with added or modified columns


assign() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.assign.
html

Concatenates two DataFrames along a specified axis


append() https://pandas.pydata.org/pandas-
docs/version/1.4/reference/api/pandas.DataFrame.append.html

Filter a DataFrame based on a specified query expression, allowing for concise


and readable filtering conditions.
query()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.query.h
tml

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Quantile-based discretization, assigning data points to discrete bins based
on specified quantiles, facilitating the creation of bins with approximately
qcut()
equal numbers of observations.
https://pandas.pydata.org/docs/reference/api/pandas.qcut.html

Extract the quarter component from a DatetimeIndex or datetime-like


object, providing the quarter of the year (1 to 4) for each corresponding
date.
quarter()
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.quarter
.html

Context of a categorical data type to access the unique categories or


categories labels present in a categorical
https://pandas.pydata.org/docs/user_guide/categorical.html

Round down datetime-like values in a DateTimeIndex, TimedeltaIndex, or


Series to the nearest specified frequency, facilitating alignment or
floor() aggregation based on that frequency.
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.floor.ht
ml

Perform integer division element-wise, equivalent to the // operator,


between a DataFrame or Series and another DataFrame, Series, or a scalar.
floordiv()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.floor
div.html

Rounds up the values of a DataFrame, Series, or numeric array to the


nearest integer greater than or equal to the original values.
ceil()
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.ceil.ht
ml

Checks if each element in a Series or DataFrame contains a specified string


or pattern, providing a boolean result indicating the presence or absence of
contains() the pattern in each element.
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.contai
ns.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Checks if each element in a Series or Index ends with a specified suffix,
returning a boolean Series indicating the presence or absence of the suffix.
endswith
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.endswit
h.html

Determine if two pandas objects, such as Series or DataFrames, are equal,


returning a boolean value indicating whether they have the same shape and
equals() elements.
https://pandas.pydata.org/pandas-
docs/stable/reference/api/pandas.DataFrame.equals.html

Extract capture groups from a Series of strings using regular expressions,


generating a DataFrame with columns for each capture group.
extract
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.extract.
html

Returns the initial n non-null/true values from a DataFrame or Series.


first https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.first.h
tml

Combine two or more DataFrames based on a common column, providing a


merged DataFrame with matched values.
merge
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.merg
e.html

Retrieve the memory usage of each column in a DataFrame, providing


memory information about the memory footprint of the DataFrame.
_usge() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.mem
ory_usage.html

Method limits the values in a DataFrame or Series to a specified range,


replacing values outside that range with the specified minimum or
clip maximum.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.clip.ht
ml

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Capitalize the first character of each string element in a Series or Index
capitalize https://pandas.pydata.org/docs/reference/api/pandas.Series.str.capit
alize.html

Method transforms each string element in a Series to its Unicode case-


folded form, ensuring a consistent and case-insensitive representation
casefold for comparison purposes
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.case
fold.html

Element-wise comparison, returning a Boolean mask indicating where


the elements of a DataFrame or Series are greater than or equal to a
ge() specified value.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ge.
html

Retrieves values from dictionaries or pandas objects based on specified


keys or indices, with optional default values if not found.
get()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.get
.html

Converts categorical variables into binary (0 or 1) one-hot encoded


columns, facilitating the representation of categorical data for machine
get_dummi
learning models.
es()
https://pandas.pydata.org/docs/reference/api/pandas.get_dummies.
html

Allowing you to retrieve a specific group of data from a DataFrame


grouped by a particular criterion.
get_group()
https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.
DataFrameGroupBy.get_group.html

Aspecified value, returning a boolean mask indicating where the


elements are greater than the given value
gt()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.gt.
html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Apply a color gradient to highlight values in a DataFrame based on
style.backgrou their magnitudes.
nd_gradient() https://pandas.pydata.org/docs/reference/api/pandas.io.formats.s
tyle.Styler.background_gradient.html

Visually highlight the maximum values in a DataFrame by applying a


specific style to those cells.
https://pandas.pydata.org/pandas-
docs/version/1.1/reference/api/pandas.io.formats.style.Styler.highli
style.highlight_
ght_max.html#:~:text=Highlight%20the%20maximum%20by%20sh
max()
ading%20the%20background.&text=A%20valid%20slice%20for%20d
ata%20to%20limit%20the%20style%20application%20to.&text=Appl
y%20to%20each%20column%20(%20axis,at%20once%20with%20axi
s%3DNone%20.

Usually highlights null or missing values in a DataFrame with a


specified color.
style.highlight_
https://pandas.pydata.org/pandas-
null()
docs/stable/reference/api/pandas.io.formats.style.Styler.highlight
_null.html

Create histograms, providing a visual representation of the distribution


of numerical data
hist
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.
hist.html

Fills missing values in a DataFrame or Series by estimating


intermediate values using various interpolation techniques.
interpolate
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.
interpolate.html

Fill or propagate missing values forward in a DataFrame or Series by


carrying the last observed non-null value forward along the specified
pad() axis.
https://pandas.pydata.org/pandas-
docs/stable/reference/api/pandas.DataFrame.pad.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Facilitates a clean and expressive way to apply a sequence of
functions to a DataFrame or Series, enabling readable and modular
pipe() data manipulation.
https://pandas.pydata.org/docs/reference/api/pandas.DataFram
e.pipe.html

Create a pivot table from a DataFrame, allowing users to aggregate


and summarize data based on specified columns and aggregation
pivot_table() functions.
https://pandas.pydata.org/docs/reference/api/pandas.pivot_tab
le.html

Calculate the product of all elements in a DataFrame or Series


prod https://pandas.pydata.org/docs/reference/api/pandas.DataFram
e.prod.html

Reshape a DataFrame by converting unique values from one column


into new columns, creating a pivot table representation of the data.
pivot()
https://pandas.pydata.org/docs/reference/api/pandas.DataFram
e.pivot.html

Compares elements of two DataFrames or Series element-wise and


produces a boolean DataFrame or Series indicating where the
ne elements are not equal.
https://pandas.pydata.org/docs/reference/api/pandas.DataFram
e.ne.html

Used in conjunction with groupby(), assigns a unique integer group


label to each distinct group of values within a DataFrame or Series.
ngroup
https://pandas.pydata.org/docs/reference/api/pandas.core.grou
pby.DataFrameGroupBy.ngroup.html

Aligns DataFrame or Series data to a new index, filling missing values


with NaN.
reindex
https://pandas.pydata.org/docs/reference/api/pandas.DataFram
e.reindex.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Reverts any changes to the DataFrame's index, restoring a default
integer-based index or modifying the DataFrame in-place with
reset_index() inplace=True.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.
reset_index.html

Reversed integer floor division, equivalent to the // operator with


operands reversed (y // x).
rfloordiv
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.
rfloordiv.html

For strings, returning the last index of a specified substring within the
string.
rindex
https://pandas.pydata.org/pandas-
docs/stable/reference/api/pandas.Series.str.rindex.html

Right-justifies a string within a specified width by padding it with a


specified character (default is whitespace) on the left.
rjust
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rj
ust.html

create a slice object, defining a range of indices that can be applied to


sequences like lists, strings, or tuples to extract a portion of the
slice() sequence.
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.sli
ce.html

String method that divides a string into a list of substrings using a


specified delimiter or, by default, whitespace.
split()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.sp
lit.html

Transforms columns into a multi-level index, reshaping the DataFrame


by moving data from columns to rows.
stack
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.
stack.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


string method that checks if a string begins with a specified prefix,
returning True or False.
startawith
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.st
artswith.html

Pivots a level of the index, converting a multi-level index into columns.


It is often used to reverse the operation performed by stack().
unstack()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.
unstack.html

Identifies and displays differences between two DataFrames in terms


compare of added, removed, or modified values.
https://pandas.pydata.org/docs/user_guide/merging.html

Converts a Series or DataFrame column to numeric data, handling


non-numeric values and providing options for error handling and
to_numeric() downcasting.
https://pandas.pydata.org/docs/reference/api/pandas.to_numeri
c.html

Method is used to detect missing or NaN (Not a Number) values in a


DataFrame or Series, returning a boolean mask of the same shape
isna with True indicating the presence of a NaN value
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.
isna.html

To check for whitespace characters in string columns, returning a


boolean mask.
isspace
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.is
space.html

To check if each element in a string Series follows titlecase formatting,


returning a boolean Series.
istitle
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.is
title.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Check if each character in a string Series is in uppercase, returning a
boolean Series.
isupper
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.isup
per.html

Method that allows iterating over the columns of a DataFrame as


(column_name, Series) pairs, providing access to both the column name
iteritems and the data of each column.
https://pandas.pydata.org/pandas-
docs/version/1.4/reference/api/pandas.DataFrame.iteritems.html

Method that allows iterating over the rows of a DataFrame as


namedtuples, providing a more efficient way to access the values of
itertuples each row compared to iterrows()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.iter
tuples.html

Method that allows iterating over the rows of a DataFrame as (index,


Series) pairs, providing access to both the index and the data of each
iterrows row.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.iter
rows.html

String splitting within DataFrames or Series, you typically use the


str.split() method
rsplit
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rstri
p.html

A set of specified characters from each string in the Series/Index from


right side
rstrip
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rstri
p.html

Get Subtraction of dataframe and other, element-wise (binary operator


rsub)
rsub
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rsu
b.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


It is a string method in Python, not applicable to DataFrames or Series.
rjust https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rju
st.html

To perform rolling window calculations on a Series or DataFrame,


enabling operations like mean, sum, etc., over a specified window of
rolling consecutive data points.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.r
olling.html

Function is used to round the values in a DataFrame or Series to a


specified number of decimal places or to the nearest integer.
round
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.r
ound.html

It is a string method in Python, not applicable to DataFrames or Series.


rpartition https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rpa
rtition.html

Get Floating division of dataframe and other, element-wise (binary


operator rtruediv).
rtruediv
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.r
truediv.html

Randomly selects rows from a DataFrame, facilitating the creation of


random subsets for analysis.
sample
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.s
ample.html

Calculates the standard error of the mean for a numeric column or


series, providing a measure of the precision of the sample mean
sem estimate.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.s
em.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Method is used with the Styler object to set a caption for a DataFrame,
providing a title or additional information that is displayed when the
set_caption DataFrame is rendered as an HTML table.
https://pandas.pydata.org/docs/reference/api/pandas.io.formats.styl
e.Styler.set_caption.html

Method is used to set the categories of a Categorical data type. It allows


you to redefine the categories of a categorical column, specifying the
set_categori desired order and presence of categories, which can be useful for
es operations like reordering or adding new categories.
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.set_
categories.html

Method is used to set one or more columns as the index of a DataFrame,


allowing for quick and efficient access to the data based on the specified
set_index column(s).
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.set
_index.html

Method is used with the Styler object to set CSS properties for the
elements of a DataFrame, allowing customization of the display by
set_properti modifying font styles, colors, and other visual aspects.
es https://pandas.pydata.org/pandas-
docs/stable/reference/api/pandas.io.formats.style.Styler.set_properti
es.html

Method is used to apply custom CSS styles to the header (thead) and
body (tbody) elements of a DataFrame when using the Styler API for
set_table_s
enhanced customization of the display.
tyles
https://pandas.pydata.org/docs/reference/api/pandas.io.formats.styl
e.Styler.set_table_styles.html

Function is used to shift the elements of a DataFrame or Series along a


specified axis, introducing NaN values at the locations where the data is
shift shifted.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.shi
ft.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Checks if each element in a Series contains a substring or matches a
pattern, returning a boolean mask.
str.contains
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.con
tains.html

Method that counts the occurrences of a specified substring in each


element of a Series with string values, returning a new Series of counts.
str.count
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.cou
nt.html

The size attribute returns the total number of elements in a DataFrame or


Series, while the shape attribute provides the number of rows and
size columns seperatly.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.si
ze.html

Encode character string in the Series/Index using indicated encoding.


str.encode https://pandas.pydata.org/docs/reference/api/pandas.Series.str.enc
ode.html

Check if each element in a Series of strings ends with a specified suffix


and returns a boolean Series indicating the results.
str.endswith
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.end
swith.html

That extracts substrings from a Series of strings using a specified regular


expression, and it can be applied concisely using method chaining.
str.extract()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.extr
act.html

String method in Python that returns the lowest index of the first
occurrence of a specified substring within the string. If the substring is
str.find not found, it returns -1.
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.find.
html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Checks whether each element in a string Series contains only alphabetic
str.isalpha characters, returning a boolean Series of the same length.
() https://pandas.pydata.org/docs/reference/api/pandas.Series.str.isalpha.ht
ml

Python converts a value to its string representation, facilitating operations


str() involving string manipulation or display.
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.html

Convert strings in the Series/Index to be capitalized


str.capitali
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.capitalize
ze()
.html

Performs case-folding on strings in a Series or DataFrame column, making


str.casefol comparisons case-insensitive.
d https://pandas.pydata.org/docs/reference/api/pandas.Series.str.casefold.
html

Concatenates strings in a Series or DataFrame column, allowing you to specify


str.cat a separator and handle missing values.
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.cat.html

Centers the strings in each element of a column by padding with a specified


str.center( character to achieve a desired width.
) https://pandas.pydata.org/docs/reference/api/pandas.Series.str.center.ht
ml

Extract element from each component at specified position or with specified


str.get key
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.get.html

Converts a Series of strings into a DataFrame of dummy variables,


str.get_du representing the presence or absence of each element in the original strings.
mmies https://pandas.pydata.org/docs/reference/api/pandas.Series.str.get_dum
mies.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Have str.index(), use str.find() for similar functionality, obtaining the
index of the first substring occurrence in each element of a string Series.
str.index()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ind
ex.html

Pandas checks if each element in a string Series contains only


alphanumeric characters (letters and numbers), returning a boolean
str.isalnum Series of the same length.
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.isal
num.html

Used to find all occurrences of a pattern or regular expression in each


element of a string Series, returning the results as lists in a new Series.
str.findall()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.fin
dall.html

Checks if each character in a string column represents a decimal digit,


providing a boolean result for each element.
str.isdecimal
https://pandas.pydata.org/docs/reference/api/pandas.Serie
s.str.isdecimal.html

Checks if each character in a string column represents a digit, returning


a boolean result for each element.
str.isdigit()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.isdi
git.html

Checks for the presence of a substring or regex pattern in each element


str.contains( of a string column, providing a boolean result for each element.
) https://pandas.pydata.org/docs/reference/api/pandas.Series.str.co
ntains.html

String method that returns a boolean mask indicating whether each


character in each element of a Series is a lowercase letter.
str.islower
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.islo
wer.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


String method that returns a boolean mask indicating whether each
str.isnumeri character in each element of a Series is a numeric character.
c https://pandas.pydata.org/docs/reference/api/pandas.Series.str.isnu
meric.html

String method that returns a boolean mask indicating whether each


character in each element of a Series is a whitespace character.
str.isspace
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.issp
ace.html

Checks if each word in a Series element is in titlecase, returning a


boolean mask.
str.istitle
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.istitl
e.html

String method that returns a boolean mask indicating whether each


character in each element of a Series is an uppercase letter.
str.isupper
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.isup
per.html

Join lists contained as elements


str.join
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.join.
html

Computes the length (number of characters) of each string element in a


Series, returning a new Series with the computed lengths.
str.len
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.len.
html

Duplicate each string in the Series or Index


str.repeat https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rep
eat.html

Aligns the strings in a Series by padding them to a specified width with a


specified character
str.ljust
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ljust
.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


String method that converts all characters in each element of a Series
to lowercase.
str.lower
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.low
er.html

Each element in a Series matches a specified regular expression


pattern, returning a Boolean Series.
str.match
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.ma
tch.html

Normalizes Unicode strings in a Series using a specified normalization


form.
str.normalize
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.nor
malize.html

Pad strings in a Series with a specified character to achieve a minimum


width.
str.pad
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.pa
d.html

Split the string at the first occurrence


str.partition https://pandas.pydata.org/docs/reference/api/pandas.Series.str.par
tition.html

Used to replace occurrences of a specified substring with another


substring within a given string.
str.replace
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rep
lace.html

Finds the highest index of a substring from the right side of the string or
returns -1 if not found.
str.rfind
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rfin
d.html

Finds the highest index of a substring from the right side of the string.
str.rindex https://pandas.pydata.org/pandas-
docs/stable/reference/api/pandas.Series.str.rindex.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


String method applied to a Series to remove leading and trailing
whitespaces from each element in the Series.
str.strip()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.strip.ht
ml

Method replaces values in a DataFrame based on a specified condition,


setting them to an alternative value where the condition is False.
where
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.wher
e.html

str.wrap( Wrap strings in Series/Index at specified line width.


) https://pandas.pydata.org/docs/reference/api/pandas.Series.str.wrap.ht
ml

In pandas right-justifies strings in a DataFrame column, padding with


spaces to a specified width.
str.rjust
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.rjust.ht
ml

Creates a deep copy of a DataFrame or Series, allowing modifications to the


copy without affecting the original data structure.
copy()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.copy.
html

Aligns two objects based on their indexes, filling in missing values with NaN
to facilitate operations between them.
align
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.align.
html

Combines two DataFrames based on their indexes, simplifying index-based


merging compared to the more versatile merge() method.
join()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.join.h
tml

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Freedom to add different functions whenever needed like lambda function,
sort function, etc. We can apply a lambda function to both the columns and
lambda rows of the Pandas data frame.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.apply.
html

Often pertains to the last() method for retrieving the last non-null element
from a Series or the last attribute for accessing the last row of a DataFrame.
last()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.last.ht
ml

Element-wise "less than or equal to" comparisons in a DataFrame or Series,


generating a boolean result.
le
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.le.htm
l

To get the number of rows in a DataFrame (len(df)) or the length of a Series


(len(series))
len()
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.len.html

Checks if each element in a Series or DataFrame is less than a specified


value, returning a boolean mask
lt()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.lt.htm
l

Reshapes a DataFrame from wide to long format by unpivoting it, combining


melt() specified columns into variable and value columns.
https://pandas.pydata.org/docs/reference/api/pandas.melt.html

Returns the memory usage of each DataFrame column, including deep


memory memory inspection for objects, and the total memory usage
_usage() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.mem
ory_usage.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Combines two DataFrames based on a common key, facilitating the
integration of data from different sources.
merge
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.me
rge.html

Handle merge issues


mergeError https://pandas.pydata.org/docs/reference/api/pandas.errors.MergeEr
ror.html

Rolling window calculations on sequential data, such as calculating


mean or sum over a specified window size in a DataFrame or Series.
rolling()
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rollin
g.html

Applies a specified function element-wise to every element in a


applyymap DataFrame.
() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ap
plymap.html

Extracts the day names from the datetime column and creates a new
column 'day_name' in the DataFrame.
day_name
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.day_
name.html

Extracts the day of the week as integers (0 to 6) from the datetime


column and creates a new column
dayofweek
https://pandas.pydata.org/docs/reference/api/pandas.DatetimeIndex
.dayofweek.html

Extracts the hour component from the datetime column and creates a
new column 'hour' in the DataFrame.
hour
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.hour.
html

Extracts the minute component from the datetime column and creates a
new column 'minute' in the DataFrame.
minute
https://pandas.pydata.org/pandas-
docs/stable/reference/api/pandas.Series.dt.minute.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Extracts the day component from the datetime column and creates a
day
new column 'day' in the DataFrame.

Extracts the microsecond component from the datetime column and


creates a new column 'microsecond' in the DataFrame.
microsecond
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.micros
econds.html

Extracts the nanosecond component from the datetime column and


creates a new column 'nanosecond' in the DataFrame.
nanosecond
https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.na
noseconds.html

Extracts the month names from the datetime column and creates a new
MONTH_NA column 'month_name' in the DataFrame.
ME https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.mon
th_name.html

Extracts the month component from the datetime column and creates a
new column 'month' in the DataFrame
month
https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.mon
th.html

Extracts the week number from the datetime column and creates a new
column 'week' in the DataFrame.
week
https://pandas.pydata.org/docs/reference/api/pandas.Timestamp.w
eek.html

Used to concatenate DataFrames or Series along specified axes,


allowing for the combination of data along rows or columns, with options
concat()
to handle indices and customize the concatenation process.
https://pandas.pydata.org/docs/reference/api/pandas.concat.html

Used to calculate the sum of values in a Series or DataFrame along a


specified axis, typically used to obtain the total of numeric data in a
sum() column or row.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.su
m.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Provides a concise way to generate a cross-tabulation or
contingency table, summarizing the counts of occurrences
crosstab() between two or more categorical variables in a DataFrame.
https://pandas.pydata.org/docs/reference/api/pandas.crosst
ab.html

Applies a function to each group of data and returns a


transformed version aligned with the original data, useful for
element-wise operations within groups or broadcasting results
transform
back to the original DataFrame or Series.
https://pandas.pydata.org/docs/reference/api/pandas.DataFr
ame.transform.html

Used to calculate the cumulative product of elements along a


given axis in a DataFrame or Series, resulting in a new Series or
cumprod DataFrame with the cumulative product values.
https://pandas.pydata.org/docs/reference/api/pandas.DataFr
ame.cumprod.html

Computes the cumulative maximum along a specified axis,


providing a new Series or DataFrame where each element is the
maximum value encountered up to that point along the chosen
cumax
axis
https://pandas.pydata.org/docs/reference/api/pandas.DataFr
ame.cummax.html

Creates an expanding view for calculations, producing a Series


or DataFrame where each element represents the result of
applying a function to all preceding elements along a specified
expanding
axis.
https://pandas.pydata.org/docs/reference/api/pandas.DataFr
ame.expanding.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K


Import Files

CSV files
pd.read_csv() https://pandas.pydata.org/docs/referenc
e/api/pandas.read_csv.html

Excel files
pd.read_excel() https://pandas.pydata.org/docs/referenc
e/api/pandas.read_excel.html

JSON files
pd.read_json() https://pandas.pydata.org/docs/referenc
e/api/pandas.read_json.html

SQL database queries


pd.read_sql() https://pandas.pydata.org/docs/referenc
e/api/pandas.read_sql.html

www.hopelearning.net Single Tutor | Learn without Confusions Ramisha Rani K

You might also like