import numpy as np
a = np.array([1, 2, 3])
print(a * 2)
[2,4,6]
What keyword begins every function definition?
def
common command to import pandas library
import pandas as pd
Process that runs mathematical operations on entire arrays
Vectorization
Which common file format uses commas to separate data values?
CSV
num = np.array([83.5, 79.1, 93.7, 88.6, 92.3])
output of num.max?
93.7
terminates a loop immediately
break
If a dataframe has 97,640 rows and 15 columns, what does df.shape return?
(97640,15)
dtype of np.array([1, "apple", 3.0])
string
Acronym used when data is missing (Not a number)
NaN
a = np.array([10, 20])
b = np.array([1, 2])
print(a / b)
[10.0, 10.0]
Programming structure that repeats a random process several times
For loop
Displays the first 5 rows by default
df.head()
returns tuple describing dimensions of array
.shape
Returns the mean, min, and max for all numerical columns ( .__ )
.describe
a2 = np.array([1, 2, 3])
print(a2[a2 > 1])
[2, 3]
ensures the same results are produced every time
Seed
Does .loc[0:2] include or exclude the row at index 2?
Include (Label-based slicing is inclusive).
NumPy equivalent of `range(start, stop, step)` in Python
np.arange
arr = np.array([1, 4, 9])
print(np.sqrt(arr).sum())
6
Selects an outcome from a set of possible options
np.random.choice()
What statement removes a key from a dictionary?
What function checks if two conditions are both True at the same time?
np.logical_and()
What argument do you add to pd.read_csv() to use the first column as the row labels?
index_col = 0