lecture python Flashcards

1
Q

dictionary

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

built-in functions

A

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().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

functions

A

lead to (1) less code to write, (2) less code to debug and modify, and (3) less code to read.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

defining

A

means (1) the name of the function, (2) what arguments it receives, and (3) what value it returns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

calling

A

means (1) using the function, (2) providing arguments, and (3) getting the return value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

modules

A

contain functions, eg. math module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

yfinance

A

module that gathers stock information from Yahoo Finance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

mplfinance

A

module that creates graphs from financial data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

numpy-financial

A

a collection of financial and accounting functtions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

keys() method

A

can be used to make a list of the keys in a dictionary. eg., car_info1.keys()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

abs()

A

a function that returns the absolute value of an argument. eg., -5 returns 5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

dataframe.dtypes

A

indicates the type of data in each column of a dataframe.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

head() method

A

shows the first x amount of columns in a dataframe, as specified by the argument.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

apply() method

A

applies a function to every element of a column or dataframe, as specified in the argument.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

plot.bar

A

a method used to plot a bar graph. barh, gives a horizontal bar graph.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

_

A

gets rid of the display at the top of a graph. eg. _ = …

17
Q

describe() method

A

used to generate descriptive statistics for a dataframe.

18
Q

bins

A

specifies the number of intervals into which the data will be divided in eg. a histogram.

19
Q

pd.cut

A

a function from the pd module that takes a list of values.

20
Q

sample method

A

returns a random sample from a dataframe.

21
Q

upper() method

A

a method that converts a string value into uppercase.

22
Q

strip() method

A

method used to remove leading and trailing spaces whitespaces.

23
Q

isalpha() method

A

a method to check if all the characters in a string are alphabetic. It returns True if all characters in the string are alphabetic (letters), otherwise it returns False.

24
Q

80/20 rule

A

indicates that 80% of your time is spent shaping and cleaning your data and 20% is spent visualising data.

25
Q

slicing

A

data can be seen as a cube with multiple dimensions. with slicing, we only want one part of the data cube.

26
Q

dice

A

selects specific values of multiple dimensions to produce a new subcube.

27
Q

pd.series()

A

a method that creates a series object. it is capable of holding any data type and similar to a list, but with more features.