
Python Analytics - Advanced Analysis and ML
groupby, merge, pivot_table, apply/map, Plotly, Scikit-Learn (regression, classification, clustering), train/test split, metrics, Jupyter, Google Colab
1What is the main difference between apply() and map() methods on a Pandas Series?
What is the main difference between apply() and map() methods on a Pandas Series?
Answer
The map() method is designed to map each value in a Series to a new value using a dictionary or function, and works only on Series. In contrast, apply() is more flexible: it can apply a function element-wise on a Series or row-wise/column-wise on a DataFrame. For simple value-to-value transformations on a Series, map() is generally faster and more readable.
2Which Pandas method should be used to aggregate data with multiple aggregation functions on different columns simultaneously?
Which Pandas method should be used to aggregate data with multiple aggregation functions on different columns simultaneously?
Answer
The agg() (or aggregate()) method allows applying different aggregation functions to different columns in a single operation. It accepts a dictionary where keys are column names and values are the functions to apply. This approach is more efficient and readable than chaining multiple groupby calls with individual functions.
3What is the difference between merge() and join() in Pandas?
What is the difference between merge() and join() in Pandas?
Answer
merge() is a more flexible function that joins two DataFrames on specific columns using the on, left_on/right_on parameters, or indexes. join() is a DataFrame method that joins on indexes by default and is more concise for simple index-based joins. For complex joins on non-index columns, merge() is preferable as it offers more control over join columns.
How to create a pivot table with pivot_table() specifying multiple aggregation functions?
What is the purpose of transform() in a groupby() context compared to apply()?
+17 interview questions
Other Data Analytics interview topics
Google Sheets - Fundamentals
Google Sheets - Advanced Formulas
SQL - Fundamentals
SQL - Aggregations and Grouping
SQL - Joins
BigQuery - Fundamentals
Data Cleaning
KPIs and Business Metrics
Descriptive Statistics
Zapier and No-Code Automation
Data Visualization Principles
Python & Pandas - Fundamentals
Google Sheets - Automated Dashboards
SQL - Subqueries and CTEs
SQL - Window Functions
BigQuery - Advanced Features
Data Modeling
Funnel and Conversion Analysis
Cohort and Retention Analysis
Google Tag Manager and Tracking
APIs and Webhooks
dbt - Fundamentals
AB Testing and Applied Statistics
Looker Studio (Google Data Studio)
Power BI - Fundamentals
SQL - Advanced Analytical Queries
dbt - Advanced Features
Power BI - DAX and Advanced Dashboards
Master Data Analytics for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free