Flashcards · Pandas · Free
Pandas flashcards, generated for you.
Example Pandas study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example Pandas flashcards
What is a pandas DataFrame and how does it differ from a Series?
A DataFrame is a 2D table with rows and columns (like SQL table or Excel sheet). A Series is 1D labeled array (single column). DataFrames are made of multiple Series.
How do you select a single column from a DataFrame df?
Use df['column_name'] or df.column_name. Returns a Series. Use df[['column_name']] with double brackets to keep it as a DataFrame.
What is the difference between .loc and .iloc in pandas?
.loc uses label-based indexing (row/column names). .iloc uses integer position-based indexing (0, 1, 2, ...). Example: df.loc['row1', 'col1'] vs df.iloc[0, 0]
How do you filter a DataFrame to rows where a column meets a condition?
Use boolean indexing: df[df['column'] > value]. Returns DataFrame with only rows where condition is True. Chain conditions with & (and), | (or), ~ (not).
What does .groupby() do and what is a typical workflow?
.groupby(column) splits data by unique values in a column, creating groups. Chain with aggregation: df.groupby('category').sum(), .mean(), .count(), etc. Returns grouped results.
How do you merge two DataFrames and what are the join types?
pd.merge(df1, df2, on='key') joins on shared column. join types: 'inner' (matching keys only), 'outer' (all keys), 'left' (all from df1), 'right' (all from df2).
What is the difference between .merge() and .join() in pandas?
.merge() joins on column values (more flexible). .join() joins on indices by default. .join() is shorthand: df1.join(df2) merges by index. Both can use 'on' or 'left_on'/'right_on'.
How do you handle missing values (NaN) in pandas?
.isna() or .isnull() detects NaN. .dropna() removes rows/columns with NaN. .fillna(value) replaces NaN. .fillna(method='ffill') forward-fills, .fillna(method='bfill') back-fills.
What is .apply() and when would you use it instead of vectorized operations?
.apply(func) applies a function to each row/column. Use for complex logic, custom functions, or operations pandas doesn't optimize. Slower than vectorized ops but more flexible. df.apply(lambda x: x + 1)
How do you pivot data and what is the difference between .pivot() and .pivot_table()?
.pivot(index, columns, values) reshapes data (no aggregation). Errors if duplicates exist. .pivot_table(index, columns, values, aggfunc='mean') reshapes and aggregates duplicates. pivot_table is safer and more common.
Make your own Pandas study set
Flashcards for related topics
Studying Pandas to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →