lecture python Flashcards
dictionary
a list where the index can be (almost) anything, eg. a string or a number. the index is called a key. what is available at this key is called a value.
built-in functions
functions that are already built. Most of what you want to do with a list already exists as a function, eg. sum(), max(), and min().
functions
lead to (1) less code to write, (2) less code to debug and modify, and (3) less code to read.
defining
means (1) the name of the function, (2) what arguments it receives, and (3) what value it returns.
calling
means (1) using the function, (2) providing arguments, and (3) getting the return value.
modules
contain functions, eg. math module.
yfinance
module that gathers stock information from Yahoo Finance.
mplfinance
module that creates graphs from financial data.
numpy-financial
a collection of financial and accounting functtions.
keys() method
can be used to make a list of the keys in a dictionary. eg., car_info1.keys()
abs()
a function that returns the absolute value of an argument. eg., -5 returns 5.
dataframe.dtypes
indicates the type of data in each column of a dataframe.
head() method
shows the first x amount of columns in a dataframe, as specified by the argument.
apply() method
applies a function to every element of a column or dataframe, as specified in the argument.
plot.bar
a method used to plot a bar graph. barh, gives a horizontal bar graph.