Loading

Quipoin Menu

Learn • Practice • Grow

python-for-ai / Series and DataFrames
tutorial

Series and DataFrames

Pandas is the go‑to library for data manipulation in Python. It introduces two main structures: Series (1D labeled array) and DataFrame (2D table with rows and columns). Almost all AI data preprocessing starts with Pandas.

A DataFrame is like an Excel spreadsheet or SQL table – rows are observations, columns are features.

Creating a DataFrame

import pandas as pd

# From a dictionary
data = {
'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35],
'Score': [85, 90, 88]
}
df = pd.DataFrame(data)
print(df)
Output:
      Name  Age  Score
0 Alice 25 85
1 Bob 30 90
2 Charlie 35 88

Series – A Single Column

ages = df['Age']
print(ages) # Series with index 0,1,2
print(ages.mean()) # 30.0

Basic DataFrame Inspection

df.head() # first 5 rows
df.info() # data types and missing values
df.describe() # statistics for numeric columns

Why Pandas for AI?

  • Load datasets from CSV, Excel, JSON, SQL.
  • Clean data: handle missing values, remove duplicates.
  • Filter rows, select columns, group by categories.
  • Merge multiple datasets (train + test, features + labels).


Two Minute Drill
  • DataFrame = 2D table (rows, columns).
  • Series = single column.
  • df.head() preview, df.info() summary, df.describe() stats.
  • Pandas is essential for data loading and preprocessing in AI.

Need more clarification?

Drop us an email at career@quipoinfotech.com