1/47
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
abs()
returns the absolute value of the function in the parentheses
round(x,y)
rounds x to y digits to the right of the decimal. y can be negative to round to the 10s/100s place, and if left blank rounds to the nearest integer. If 0.5, rounds to the nearest even integer.
table.show(x)
shows x number of rows of the table as a picture(can’t do functions on it)
table.select(x)
creates a new table with only the ‘x’ columns
table.drop(x)
creates a new table without the ‘x’ columns
table.where(x, y)
creates a new table with only the values in column x that meet condition y
table.sort(x)
sorts the table by column x, from least to greatest. can put “, descending = True” after x to sort the table from greatest to least
When is a float returned as an answer
when one of the variables is a float or division is used.
‘string’ + ‘string’
‘stringstring’
‘string’ * 3
‘stringstringstring’
int(‘x’) & Condition
returns x as an integer
X can’t have decimals
float(‘x’)
x.0
type(x)
returns the type of value that x is
make_array('x’, ‘y’, ‘z’)
makes an array with elements x, y, z
array *, /, -, +, ** x
applies the function to each individual value of the array
len(x)
returns the # of columns in a table or the # of items in an array
array.item(x)
returns the item in the array(starts at item 0, can be negative)
np.arange(x) OR np.arange(y,z)
gives an array with x # of values in it
OR
gives an array starting at y and ending at the last value less than z
Table.()
creates an empty column
.with_column(x,y)
adds a column with title ‘x’ and array ‘y’ as its values
.num_rows OR .num_columns
gives the number of rows or columns in a table
.labels
gives the names of the columns of a table
.set_format(x, PercentFormatter)
Makes a decimal into a percent
table.plot(x,y)
makes a line graph with axes “x” and “y”
table.relabeled(x,y)
x is either a number(starts at 0, goes from left to right) or the name of the column. y is the new label
plots.ylim(x,y) OR plots.xlim(x,y)
sets the lower bound of a line plot axis at x and the upper bound at y
table.scatter(x,y, group = z)
scatterplot with “x” on the horizontal axis and “y” on the vertical axis, and with different colored dots based on grouping z.
table.take(x) or table.take(np.arange(y))
takes the (x-1)th value of a table and makes it a new table
makes a new table with the top y values from the table
table.barh(‘x’, ‘y’)
creates a bar chart with ‘x’ as the horizontal axis and ‘y’ as the vertical axis
table.group(‘x’)
creates a new table with columns “x” and “count”
table.bin(x, bins = np.arange(y,z,a))
arranges variable x into bins ranging from y to z spaced “a” apart
table.hist(x, bins = y, (normed = False))
creates a histogram of variable x with bins y; it has percent per unit x as the default y variable
if normed = False, uses Count as the y-axis variable
plots.plot(x,y)
creates a graph of the given x values and the given y values. can use arrays for both to make line segments.
plots.title(x)
titles the plot “x”
def function(x):
return (function 2)
defines function of x as function 2
NOTE: variables defined in the function cannot be called later on
string.count(x)
count the number of “x” in the string
table.apply(x,y)
applies function x to column y
np.unique(x)
gives the unique values in array x
plots.axvline(x)
puts a vertical line at a specified x value on a plot
table.group(x,np.y)
creates a table grouped by value x, with the np.y function applied to the values it displays
table.pivot(x,y,z, (np.a))
creates a 2 way table with x as the column grouper, y as the row grouper, z as the measured variable, and np.a as the function applied to the values.
table1.join(x,y,z)
adds a new column to table1, matching the values in column x to the values in column z from table y. Unmatched values will not display in the table.
Table().read_table(x)
makes a table with the values read from table x.
np.diff(array))
returns another array with n-1 values about the difference in the values (n2-n1, n3-n2, etc.)
are.between(x,y)
are.between_or_equal_to(x,y)
are.strictly_between(x,y)
greater than or equal to x, and less than y
greater than or equal to x, and less than or equal to y
greater than x and less than y
are.contained_in(A)
is a substring of A(string) or element of A(array)
are.containing(S)
contain the string s