
Pandas Basics
DataFrames, Series, indexing, selection, filtering, missing values, data types
1What is the main Pandas data structure for storing tabular data with named rows and columns?
What is the main Pandas data structure for storing tabular data with named rows and columns?
Answer
The DataFrame is Pandas' central data structure, designed to store two-dimensional tabular data. Each column can contain a different data type, and both rows and columns have labels (index). This structure is similar to an Excel spreadsheet or SQL table, making it easy to manipulate structured data.
2Which Pandas structure represents a single column of data with an index?
Which Pandas structure represents a single column of data with an index?
Answer
A Series is a one-dimensional structure that can hold any data type (integers, strings, floats, Python objects). Each element has an associated index, allowing access to values by their label. A column extracted from a DataFrame is automatically converted to a Series.
3How to create a DataFrame from a Python dictionary where keys become column names?
How to create a DataFrame from a Python dictionary where keys become column names?
Answer
The pd.DataFrame() function directly accepts a Python dictionary. Dictionary keys automatically become column names, and values (lists or arrays) become each column's data. This method is the most common way to create DataFrames from structured data in Python.
Which method should be used to read a CSV file and load it into a DataFrame?
Which method displays the first rows of a DataFrame for a quick data preview?
+19 interview questions
Other Data Science & ML interview topics
Python Basics
Python Object-Oriented Programming
Python Data Structures
Git Fundamentals
SQL Basics
NumPy Fundamentals
Jupyter & Google Colab
SQL Joins & Advanced Queries
Advanced Pandas
Visualization with Matplotlib & Seaborn
Interactive Visualizations with Plotly
Descriptive Statistics
Inferential Statistics
Web Scraping
BigQuery & Cloud Data
Feature Engineering
Supervised ML: Regression
Supervised ML: Classification
Decision Trees & Ensembles
Unsupervised ML
ML Pipelines & Validation
Time Series & Forecasting
Deep Learning Fundamentals
TensorFlow & Keras
CNN & Image Classification
RNN & Sequences
Transformers & Attention
NLP & Hugging Face
GenAI & LangChain
MLOps & Deployment
Master Data Science & ML for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free