1/68
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
print()
Displays output in the console so you can see what your code does
string (str)
A sequence of characters inside quotes like "Hello" or 'Python'
concatenation
Combining strings using the + operator
len()
Returns the length of an object
indexing
Accessing individual characters/items using their position
negative indexing
Accessing items from the end of a sequence using negative numbers
slicing
Extracting part of a sequence using start:stop format
variable
A named container that stores a value
=
Assigns a value to a variable
==
Checks whether two values are equal
int
A whole number data type like 5 or -3
float
A decimal number data type like 3.14
complex
A number containing real and imaginary parts like 2+3j
snake_case
Naming style using lowercase letters and underscores
f-string
A formatted string that inserts variables using curly brackets
.upper()
Converts a string to uppercase
.capitalize()
Makes the first letter uppercase
.replace()
Replaces characters or text inside a string
Boolean
A data type with only True or False values
comparison operators
Operators that compare values and return True or False
list
An ordered collection of items
list indexing
Accessing list items using their position
.append()
Adds an item to the end of a list
.remove()
Removes an item from a list
for loop
Repeats code for each item in a sequence
range()
Creates a sequence of numbers for loops
while loop
Repeats code while a condition remains True
dictionary
A collection of key-value pairs stored using curly brackets
key
The label used to access a dictionary value
value
The data stored inside a dictionary
dictionary access
Getting a value using dictionary["key"]
.items()
Returns dictionary keys and values together
.values()
Returns only dictionary values
pandas
A Python library used for data analysis and manipulation
import pandas as pd
Imports pandas and gives it the shortcut name pd
DataFrame
A table-like data structure with rows and columns
pd.read_csv()
Loads a CSV file into a DataFrame
df.head()
Shows the first rows of a DataFrame
df.tail()
Shows the last rows of a DataFrame
df.sample()
Shows random rows from a DataFrame
df["column"]
Selects a column from a DataFrame
df.loc[]
Selects rows and columns using labels
df.iloc[]
Selects rows and columns using positions
df.info()
Shows DataFrame structure and data types
df.describe()
Shows summary statistics
df.shape
Shows the number of rows and columns
aggregation
Calculating summary values like sum
min
max
or mean
groupby()
Groups data by categories for analysis
agg()
Applies multiple summary calculations at once
isnull()
Checks for missing values
dropna()
Removes rows or columns containing missing values
fillna()
Replaces missing values with a chosen value
replace()
Replaces incorrect or inconsistent values
sort_values()
Sorts a DataFrame by column values
merge()
Combines DataFrames using matching columns
inner join
Keeps only rows that exist in both DataFrames
left join
Keeps all rows from the left DataFrame and matching rows from the right
concat()
Combines DataFrames by stacking rows together
list comprehension
A short way to create or modify lists
zip()
Combines multiple lists into pairs
Plotly Express
A Python library used to create interactive visualizations
px.line()
Creates a line chart
px.scatter()
Creates a scatter plot
px.bar()
Creates a bar chart
px.histogram()
Creates a histogram
px.choropleth()
Creates a map visualizatio