/
Pandas DataFrame Merge Concat GroupBy Time Series
Save to my account
Sign up
Pandas DataFrame Merge Concat GroupBy Time Series
Pandas DataFrame Merge Concat GroupBy Time Series
Study
1
Question
What is the primary use of pandas.concat (pd.concat) in DataFrames?
Answer
To combine DataFrames along an axis (rows or columns)
2
Question
When concatenating, what does ignore_index=True do?
Answer
Resets the index in the concatenated result
3
Question
What is the purpose of adding multiindex keys in a concat?
Answer
Create a hierarchical index to differentiate concatenated DataFrames
4
Question
What are the three basic join categories in merging DataFrames based on keys?
Answer
One-to-one, many-to-one, many-to-many
5
Question
What keyword specifies common columns to merge on in a merge operation?
Answer
on
6
Question
When would you use left_on and right_on in a merge?
Answer
When column names differ between DataFrames
7
Question
What do left_index and right_index enable in a merge?
Answer
Merging using index values instead of columns
8
Question
What is the purpose of suffixes in merge operations?
Answer
Prevents column name conflicts on overlapping columns
9
Question
Name a basic aggregation function commonly used in GroupBy operations.
Answer
sum or mean or min or max
10
Question
What is the fundamental idea behind GroupBy: Split, Apply, Combine?
Answer
Group by a filter, apply aggregation, and combine results into a new table
11
Question
What does the GroupBy object support for selections besides aggregations?
Answer
Column indexing and iteration over groups
12
Question
What are the four primary methods associated with GroupBy for data manipulation?
Answer
aggregate, filter, transform, apply
13
Question
What does the aggregate method allow that the basic aggregates do not?
Answer
Multiple aggregations with flexible steps
14
Question
What is the purpose of the filter method in GroupBy?
Answer
Remove groups based on conditions on group properties
15
Question
What does the transform method achieve in GroupBy operations?
Answer
Modify data while preserving original shape
16
Question
What is a common use case for apply in GroupBy context?
Answer
Apply custom functions to groups (e.g., normalize within groups)
17
Question
What is a Pivot Table in pandas used for?
Answer
Summarize data with aggregated values across dimensions
18
Question
What is the basic Pivot Table syntax used for in pandas?
Answer
Basic syntax to pivot data by rows, columns, and values
19
Question
What are multilevel pivot tables used for?
Answer
Pivot with hierarchical row/column indices for complex summaries
20
Question
What is the purpose of the full pivot table call in pandas?
Answer
Comprehensive creation of a pivot table with all options
21
Question
Which pandas feature helps work with time-series data efficiently?
Answer
Time series data handling (pd.Timestamp, DatetimeIndex, Period, Timedelta)
22
Question
What Python module pairings underlie pandas time handling?
Answer
datetime, dateutil, numpy.datetime64
23
Question
What is a pd.Timestamp?
Answer
A single timestamp backed by numpy.datetime64
24
Question
What is a pd.DatetimeIndex?
Answer
Index of timestamps for time-series data
25
Question
What is a pd.Period?
Answer
A time period with a fixed frequency (e.g., month, year)
26
Question
What is a PeriodIndex used for?
Answer
Index for Period objects in time-series data
27
Question
What is a Pd.Timedelta designed to replace?
Answer
Python's datetime.timedelta with numpy.timedelta64 basis
28
Question
What is the purpose of pd.date_range?
Answer
Create a date range sequence
29
Question
What is the difference between date_range and period_range in pandas?
Answer
date_range yields daily timestamps; period_range yields periods (e.g., months)
30
Question
What does the freq parameter in time series functions control?
Answer
The time interval frequency (e.g., 'D','M','H')