1/46
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
function
is a block of organized, reusable code that is used to perform a single, related action, provide better modularity for your application and a high degree of code reusing
parameter
is the variable listed inside the parentheses in the function definition
argument
is the value that is sent to the function when it is called.
*args
If you do not know how many arguments that will be passed into your function, add a * before the parameter name in the function definition. This way the function will receive a tuple of arguments.
**kwargs
If you do not know how many keyword arguments that will be passed into your function, add two asterisk: ** before the parameter name in the function definition. This way the function will receive a dictionary of arguments
Recursion
is a common mathematical and programming concept. It means that a function calls itself. This has the benefit of meaning that you can loop through data to reach a result.
list
is a data structure that's built into Python and holds a collection of items. Lists have a number of important, items are enclosed in square brackets
list
is a most versatile data type available in Python which can be written as a list of comma-separated values (items) between square brackets.
tuple
is a collection of objects which ordered and immutable. are sequences, just like lists, cannot be changed unlike lists and tuples use parentheses,
Dictionaries
are used to store data values in key:value pairs, is a collection which is ordered, changeable and do not allow duplicates.
set
is a collection which is unordered and unindexed, are written with curly brackets.
List
is a collection which is ordered and changeable. Allows duplicate members.
Tuple
is a collection which is ordered and unchangeable. Allows duplicate members.
Set
is a collection which is unordered and unindexed. No duplicate members.
Dictionary
is a collection which is ordered* and changeable. No duplicate members.
OOP
is a programming paradigm that models real-world entities using objects and classes, have a big impact on the result.
OBJECTS
can represent real-world objects and other (living or non-living) entities.
State and Behavior
object has 2 characteristics
class
is a template or a blueprint. An object is an instance of a what.
Class members
are declarations made inside the body of the class.
Fields
Also referred to as attributes. These are data used by the class. They are variables declared inside the class body.
Methods
Also referred to as the behavior(s). These are program statements grouped together to perform a specific function.
init() function
is called automatically every time the class is being used to create a new object.
self parameter
is a reference to the current instance of the class, and is used to access variables that belong to the class.
Constructor
This method called when an object is created from the class and it allow the class to initialize the attributes of a class.
class instantiation
Creating an object out of a class is called?
Pandas
is a Python library used for working with data sets. It has functions for analyzing, cleaning, exploring, and manipulating data
Wes McKinney
created pandas in 2008
Pandas
allows us to analyze big data and make conclusions based on statistical theories, can clean messy data sets and make them readable and relevant. Relevant data is very important in data science.
Data Science
is a branch of computer science where we study how to store, use and analyze data for deriving Information from it.
pip
The most popular package manager for Python, is today the standard tool for installing Python packages and their dependencies in a secure manner.
Pandas Series
is like a column in a table. It is a one-dimensional array holding data of any type.
label
can be used to access a specified value.
DataFrames
Data sets in Pandas are usually multi-dimensional tables, Series is like a column, it is the whole table.
loc attribute
to return one or more specified row(s)
openpyxl
is a Python library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files. It's one of the available engines that pandas supports for reading Excel files.
tail() method
returns a specified number of last rows, returns the last 5 rows if a number is not specified.
head() method
returns a specified number of rows, string from the top, returns the first 5 rows if a number is not specified.
describe() method
returns description of the data in the DataFrame, used to generate descriptive statistics of DataFrame columns. It gives a quick summary of key statistical metrics like mean, standard deviation, percentiles, and more.
info() method
also tells us how many Non-Null values there are present in each column, and in our data set
dropna() method
One way to deal with empty cells is to remove rows that contain empty cells. This is usually fine, since data sets can be very big, and removing a few rows will not have a big impact on the result.
fillna() method
allows us to replace empty cells with a value
mean() median() and mode()
methods used to calculate the respective values for a specified column
inplace=True parameter
is used in various DataFrame methods to specify whether the operation should modify the DataFrame in place or return a new DataFrame with the changes applied.
coerce
If the error argument is passed as ______ , then invalid parsing will be set as NaN .
ignore
If the error argument is passed as ______ , then invalid parsing will return the input.