Python - Data Science Flashcards
Common Python DS Functions
Name 3 libraries & their uses.
Numpy = lower level computation
Pandas = built atop numpy, used for data analysis
Scikit-Learn = use ML models
pd.read_csv(filename)
imports data from CSV file
pd.read_table(filename)
imports data from a delimited text file (like TSV)
pd.read_excel(filename)
imports data from an Excel file
pd.read_sql(query, connection_object)
reads from an SQL table/database
pd.read_json(json_string)
reads from a JSON formatted string, URL, or file
pd.read_html(url)
parses an html URL, string, or file and extracts tables to a list in a dataframe
pd.read_clipboard()
takes the contents of your clipboard and passes it to read_table()
pd.DataFrame(dict)
from a dict, keys for column names, values for data as lists
df.shape()
prints the numbers of rows and columns in a DF
df.head(n)
prints the first n rows of the DF
df.tail(n)
prints the last n rows of the DF
df.info()
returns the index, data type, and memory info