.add #adds an element to a set, if the element does not exist already in the set
.agg() #aggregates values in pandas
and #logical and
.any() #checks existence in data frames
.append() #adds to a list
.apply() #applies command on data frame value in pandas
array #is a datatype in numpy
.array() #creates an array in the numpy package
.bit_length() #
bool #is a datatype
bool() #makes a Boolean True or False from many objects
break #breaks loops
.capitalize() #makes upper case of the first letter
.chdir() #changes the directory in the os modul
chunksize #set a date portion size to load chunks in pandas' .import_csv
.clf() #erases output charts in pyplot
close() #closes a file
.columns #gives header names of data frame in pandas
.column_stack() #stacks values in numypy
Counter() #used in the collections module
.concat() #cancatenates in pandas
.conjugate() #
.cos #gives cosinus in the math package
.corrcoef() #correlation in numpy
.count() #counts elements in a list, or count of a specific element
.countplot() #creates a column chart in seaborn
.cummax() #cumulative max in pandas
.cummin() #cumulative min in pandas
.cumprod() #cumulative viz. running product in pandas
.cumsum() #cumulative viz. running sum in pandas
.DataFrame() #creates a table in the panda package
.date #creates a yyyy-mm-dd date in the datetime modul
def #defines a function
defaultdict() #special dictionary in the collections module
del #deletes
del my_list[n] #delete the n-th element from the list my_list
.describe() #gives overview for numerical values of a dataf rame
dict() #creates an empty dictionary
.difference #shows differnce between a set and a target set
.discard() #removes elements from a set
.drop_duplicates #deletes duplicates in a dataf rame in pandas
.dropna() #deletes rows with missing data in a data frame
.dt #datetime object viz. date column in a data frame
.dt.day #accesses the year of a date column in a data frame
.dt.year #accesses the year of a date column in a data frame
.dt.month #accesses the year of a date column in a data frame
elif #else-if statement in a condition
else #else statement in conditions
.endswith("x") #tells if a string ends with "x"
.environ #give the local environment in the os modul
enumarte() #creates an enumaration for an iterable
except #defines code to run when an error occurs, and subsequent code is executed
.extend() #combines lists
f #starts a formated string literal
False #logical false
.fillna() replaces null values in a pandas' data frame
filter() #filters
float #is a datatype
for #start a for-loop
[element if element == condition else 0 for element in list]
[element for element in list if element == condition]
format() #formats with a given patern
from package_anme import function #imports only a function from a package or modul
from package_anme import func1, func2 #imports only functions func1 and func2 from a package or modul
.get() #gets a value from a dictionary avoiding error messages
.getcwd() #gets the current working directory in the os modul
.grid() #add grid lines in pyplot
.groupyby() #aggregates on groups in pandas
.head() #gives the first few rows of a data frame viz. table in the panda package
help() #shows documentation
.hist() #plots a histogram in pyplot
if #starts if condition
[element if element == condition else 0 for element in list]
[element for element in list if element == condition]
.iloc #accesses data frames by their indexes
import #imports a package, or a modul
import package_anme as my_name #imports a package with an assigned name
in #logical check if a value exist in a variable or data structure
.index #gives row numbers or labels of data frame
.index() #gives e.g. the position in an iteration, or creates name labels in data frame
index_col #sets the index for a data frame in .read_csv()
.info() #gives column names of data frames in pandas
int #is a datatype
int() #makes an integer
.intersection() #intersection of sets
is #logical is operation
.isin # filters values in a data frame in pandas
.isna() #scans for missing values
.isna().any() #scans for missing values by field
.items #gives the keys and values of a dictionary as tuples in a list
iter() #creates a iterator for iterables
.iterrows() #allows loops in data frames
.join() #joins an iterable to a string
.keys #gives the keys of a dictionary, not the values
lambda #creates an anonymos function
.legend() #creates label legend in matplotlib
len() #give the length of a string, or the number of elements in a collection
list #is a collection
list() #creates a list
.loc #accesses data frames by their names
.logical_and() #and in numpy for arrays
.logical_not() #notin numpy for arrays
.logical_or() #or in numpy for arrays
.lower() #creates lower case for a string#
map() #applies a function to an iterable i.e. sequence
max() #gives the maximal value
.max() #gives the max in pandas
.mean() #calculates the mean i.e. arithmetic average in numpy, pandas etc.
.median() #calculates the median in numpy
min() #gives the minimal value
.min() #gives the min in pandas
.most_common() #show top values in a collections module
.mode() #gives the mode in pandas
namedtuple() #special tuple variant in the collections module
.nditer #iterates over a numpy array
next() #produces next value, e.g. in iterable objects
NaN #null value Not an Nmber
None #no value
not #logical not
not in #checks if a value does not exist in a variable or data structure
open() #opens a file
or #logical or
pandas #stands for panel data
.pi #gives π in the math package
pip #stands for package installer for python
.pivot_table() #creates a pivot table in pandas
.plot() #plots charts in pandas, and plots a line chart in pyplot
.pop() #deletes the last item from the list
.pop(n) #deletes the last item at position n from the list etc.
.pop("name") #detes the item "name" from the list etc.
pow() #alculates with the power
print() #prints an output on screen
PyPI #stands for python package index
raise #raises an exception viz. error message and stop code excution
.random() #creates random values in numpy
.random.rand() #creates a random number in numpy
.random.randint() #creates a random integer in numpy
.random.seed(n) #sets seed n for random generator
range() #creates a sequence of numbers
range(n,m) #n is inclusive, m is exclusive
.readline() #reads a line from a file object
.read_csv() #reads a csv into a data frame viz. table in the panda package
.relplot() #creates a relational plot in seaborn
.remove() #removes from a list
.replace() #replaces a substring
.reset_index() #resets a set index into a column in a pandas' data frame
return #returns a value from inside a function
.reverse() #reverses a list
round() #rounds a number
.safefig() #saves a chart in matplotlib
.scatter() #plots a scatter plot in pyplot
.scatterplt() #plots a scatter plot in seaborn
.set_size_inches([n,m]) #set figure size in inches in matplotlib
.shape #gives the number of rows and columns of a data frame in pandas
.show() #shows a chart in pyplot
set() #can cast a list to a set
.set_index() #turn a column into the index in a pandas' data frame
.set_palette() #sets palette in seaborn
.set_style() #sets style in seaborn
.set_title() #sets chart title in matplotlib and seaborn
.set_titels() #sets titels for subplots in seaborn
.set_xlabel() #names horizontal axis in matplotlib
.set_ylabel() #names the vertical axis in matplotlib
.std() #standard deviation in numpy and pandas
sort() #sorts values
.sort() #sorts values faster in numpy
.sort_index() #sorts on the index of a dataframe in pandas
.sort_values("header") #sorts column "header" of a dataframe in pandas
sorted() #sorts a set and returns a list
.split() #splits a string
.split("x") #splits at substring "x"
.startswith("x") #tells if a string starts with "x"
str #is a datatype
str() #creates a string
.style #a style in matplotlip
.style.use() #set a style in matplotlip
sum() #sums values
.sum() #sums values faster in numpy, pandas etc.
.suptitle() #sets a title for FaceGrit objects in seaborn
.text() #adds text inside the chart in pyplot
.tick_params() #settings for axis ticks in matplotlib
.title() #makes a title case for strings, or adds title to chart in pyplot
.to_csv() #creates a csv file from a data frame in pandas
.transpose() #transposes a numpy array
True #logical true
try #starts a try block for testing code in error handling
tuple() #converts into a tuple
.twinx() #twin copy of x axis in matplotlib
type() #gives the data type like int, float, bool, or str
.union() #union of sets
.unique() #makes a list unique
update() #add to dictionary, set etc.
.update({"my_key": value}) #updates or add to a dictionary
.upper() #makes all letters upper case
.values #gives the values of a dictionary, not the keys, and for a data frame
.value_counts() #counts values in a data frame
.var() #gives the variance in pandas
while #starts a while-loop
with open #opens, and closes a file
.xlabel() #labels horizontal axis in pyplot
.xscale() #set the scale of the horizontal axis in pyplot
.xticks() #change ticks on the horizontal axis in pyplots
yield #generator functions do not return, but they yield values back
.ylable() #labels vertical axis in pyplot
.yticks() #change ticks on the vertical axis in pyplots
zip() #combines interables
# #indicates a comment
? #shows documentation
= #calculation sign, and assigning values to variable, but Boolean values need ==
== #checks equality as True and False, is used to compare strings and values
!= # logical not equal
+ #sums numbers, or concatenates strings or lists
* #multiplies numbers, strings etc.
** #is the power of a number, or creates an arbitrary keyword argument i.e. unlimited input quantity of arguments
= #assigns a value
" #starts and ends a string
' #starts and ends a string
""" #makes a multi line string
% #modulo operator viz. rest of division
/ #division
// #floor division where the output is the floored integer
() #creates tuples, sets, generator expressions etc.
[] #creates a list i.e. collection etc.
[ … , … , … ] #is a collection of elements
[n] #indexes the n-th element in the list with first n = 0
[-n] #indexes the n-th element in the list from the back with last n = -1
[ … : … ] #slices as list
[:] #creates an explicit copy a list i.e. it handels independedly
[ … , … ] #accesses an array by row and column index
[[ … ]] #reads a data frame column into a new data frame object
{} #creates a dictiobary or set i.e. collections, inserts objects into f-strings
{ "key": value , … } #is a dictionary
{ … , … } #is a set
> #greater
>= #greater or equal
< #less
<= #less or or equal
: #indicates a task to perform, and placeholder in collections
__ #dunder, double under