Working with External Libraries Flashcards
Math is a what?
Module
A collection of variables defined by someone else
Module
You can see all the names in math using the built in function what?
dir()
What does the math.log() function do?
Returns the natural logarithm of a number, or the logarithm of number to base
It is common convention to import numpy as what?
np
It is a common convention to import pandas as what?
pd
Name some popular libraries.
Pandas
Numpy
Tensorflow
Matplotlib
Only import specific things you’ll need from each module
from math import log, pi
from numpy import asarray
Name the graphing library
mathplotlib
What do pandas functions give you?
DataFrames & Series
Subplots, Figures, TickMarks and Annotations are from what library?
matplotlib
To find out ‘what is this thing?’ use what?
type()
To find out ‘what can I do with it?’ use what?
dir()
I want to turn the array into a list… what should I use?
“tolist”
rolls.tolist()
Can you add a number to each element of an array?
Yes
What Python library is popularly used for deep learning?
Tensorflow
It is common convention to import tensorflow as what?
tf
How would you make the y-axis begin at 0?
graph.set_ylim(bottom=0)
How would you label the y-axis?
graph.set_ylabel(“Balance”)
How would you set an array of the values displayed on the y-axis?
ticks = graph.get_yticks()
How would you format those values into strings beginning with a dollar sign?
new_labels = [‘${}’. format(int(amt)) for amt in ticks]
Sets the y-axis limits for the current axes or chart
ylim