Pandas Function
Pandas Function
-Official Link
-Study Guide
Element-wise subtraction
sub() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sub.h
tml
Element-wise multiplication
mul() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.mul.h
tml
Element-wise exponentiation
pow() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.po
w.html
Summary of a DataFrame
info() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.i
nfo.html
column labels
columns() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.col
umns.html
Rename a column
rename() https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ren
ame.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
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
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
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
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
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
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 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
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
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