Recall & Review
beginner
What is a DataFrame in pandas?
A DataFrame is a labeled two-dimensional table in pandas. It has rows and columns, where each column can have a different type of data, like numbers or text.
Click to reveal answer
beginner
How are rows and columns labeled in a DataFrame?
Rows are labeled by an index, which can be numbers or custom labels. Columns have names that describe the data they hold.
Click to reveal answer
beginner
How can you create a simple DataFrame from a dictionary in pandas?
You can pass a dictionary where keys are column names and values are lists of data. For example: <br>
pd.DataFrame({'Name': ['Anna', 'Bob'], 'Age': [25, 30]})Click to reveal answer
beginner
What does it mean that a DataFrame is two-dimensional?
It means the data is organized in rows and columns, like a table or spreadsheet. You can think of it as a grid where each cell holds a value.
Click to reveal answer
beginner
Why is labeling rows and columns useful in a DataFrame?
Labels help you find and select data easily. Instead of just numbers, you can use meaningful names to understand and work with your data better.
Click to reveal answer
What is the main structure of a pandas DataFrame?
✗ Incorrect
A DataFrame is a two-dimensional table with labels for rows and columns.
How do you label rows in a DataFrame?
✗ Incorrect
Rows are labeled by an index, which can be numbers or custom labels.
Which pandas function creates a DataFrame from a dictionary?
✗ Incorrect
pd.DataFrame() creates a DataFrame, often from a dictionary of lists.
What kind of data can columns in a DataFrame hold?
✗ Incorrect
Each column can hold different types of data, such as numbers, text, or dates.
Why are column names important in a DataFrame?
✗ Incorrect
Column names describe the data in each column, making it easier to understand and use.
Explain what a DataFrame is and how it organizes data.
Think of a spreadsheet with named columns and numbered or named rows.
You got /4 concepts.
Describe how you would create a simple DataFrame using pandas.
Start with a dictionary where each key is a column name.
You got /4 concepts.