Data Analytics

Python & Pandas - Fundamentals

DataFrames, Series, indexing (loc, iloc), boolean filtering, data types, read_csv, describe, info, head/tail, shape, columns

20 interview questionsยท
Junior
1

What is the main Pandas data structure for storing tabular data?

Answer

The DataFrame is the core Pandas data structure. It represents a two-dimensional table with rows and columns, similar to a spreadsheet or SQL table. Each column is a Series, and each row has an index. The DataFrame enables efficient manipulation of structured data through its many built-in methods.

2

What is a Series in Pandas?

Answer

A Series is a one-dimensional array with an index. It represents a single column of data in a DataFrame. Each element has a label (index) enabling fast access by name or position. A Series can hold only one data type (int, float, string, etc.), which distinguishes it from a plain Python list.

3

Which Pandas function reads a CSV file and loads it into a DataFrame?

Answer

The pd.read_csv() function reads a CSV file and returns a DataFrame. It accepts many parameters: sep for the delimiter, header for the header row, encoding for file encoding, dtype to force column types, and na_values to define missing values. It is the most common method to import data into Pandas.

4

What does the df.shape attribute return on a DataFrame?

5

Which method displays the first 5 rows of a DataFrame?

+17 interview questions

Master Data Analytics for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free