1. Home
  2. Explore
  3. Computer Science
  4. Pandas Library Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Pandas Library Fundamentals

  • 37Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Pandas Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is pandas?

Tap to flipClick to flipspace

An open-source Python library designed for data manipulation and analysis.

Or swipe the card

37 cards

  1. What is pandas?

    An open-source Python library designed for data manipulation and analysis.

  2. What is the standard way to import pandas?

    import pandas as pd

  3. What are the two core data structures in pandas?

    Series (1D labeled array) and DataFrame (2D labeled data structure).

  4. What is a DataFrame in pandas?

    A two-dimensional tabular data structure with labeled rows and columns, similar to a spreadsheet or SQL table.

  5. Why is pandas faster than using Python lists for tabular data?

    Pandas is built on NumPy, which uses C-based operations and avoids Python's overhead.

  6. How do you install pandas?

    Run pip install pandas on Windows or pip3 install pandas on Mac/Linux.

  7. How can you set up a virtual environment for pandas using UV?

    Run uv init . in the project folder, then uv add pandas. Use uv run to execute Python files.

  8. What is a Jupyter notebook and why is it useful for pandas?

    An interactive environment where code is written in cells that can be run independently, ideal for data exploration.

  9. How do you load a CSV file into a DataFrame?

    df = pd.read_csv('filename.csv')

  10. What does pandas automatically assign to each row when loading data?

    A default index starting from 0.

  11. How can you create a DataFrame from a dictionary?

    pd.DataFrame({'column1': values1, 'column2': values2})

  12. What does df.head() do?

    Returns the first 5 rows of the DataFrame by default.

  13. What does df.tail() do?

    Returns the last 5 rows of the DataFrame by default.

  14. What information does df.info() provide?

    Number of entries, column names and their data types, non-null counts, and memory usage.

  15. What does df.describe() do?

    Generates descriptive statistics (count, mean, std, min, quartiles, max) for numeric columns.

  16. How do you get a list of all column names in a DataFrame?

    df.columns

  17. How do you get the index (row labels) of a DataFrame?

    df.index

  18. How do you select a single column from a DataFrame?

    df['column_name'] or df.column_name (if column name is a valid Python identifier).

  19. How do you select multiple columns from a DataFrame?

    df[['col1', 'col2']]

  20. What is the difference between iloc and loc?

    iloc uses integer-based indexing (row number), while loc uses label-based indexing (row index label or boolean condition).

  21. How do you select a single row by integer position?

    df.iloc[row_index]

  22. How do you filter rows in a DataFrame?

    df[df['column'] == value]

  23. How do you apply multiple conditions with AND in pandas?

    Use & between conditions, each enclosed in parentheses: df[(cond1) & (cond2)]

  24. How do you apply multiple conditions with OR in pandas?

    Use | between conditions, each enclosed in parentheses: df[(cond1) | (cond2)]

  25. How can you filter rows using string methods on a column?

    df[df['column'].str.startswith('prefix')] or .str.endswith('suffix')

  26. How do you filter rows where a column's value is in a given list?

    df[df['column'].isin([val1, val2, ...])]

  27. How do you negate a filter condition in pandas?

    Use the tilde operator (~) before the condition: df[~cond]

  28. How do you update a specific cell or set of cells based on a condition?

    df.loc[condition, 'column'] = new_value

  29. How can you transform an entire column (e.g., make it uppercase)?

    df['column'] = df['column'].str.upper()

  30. How do you drop a row by its index?

    df.drop(row_index)

  31. How do you drop rows with any missing values?

    df.dropna()

  32. How do you fill missing values with a specific value?

    df.fillna(value, inplace=True)

  33. How do you rename a column?

    df.rename(columns={'old_name': 'new_name'}, inplace=True)

  34. What does df['column'].value_counts() do?

    Returns a Series with counts of each unique value in the column.

  35. How do you perform a groupby operation to compute a sum?

    df.groupby('group_col')['value_col'].sum()

  36. How do you sort a DataFrame by a column?

    df.sort_values('column', ascending=True)

  37. How do you save a DataFrame to a CSV file?

    df.to_csv('filename.csv', index=True/False)

Card 1 of 37
Card 1 of 37

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent