DEV Community

Raju C
Raju C

Posted on

Week 2: Python Essentials and My First AI/ML Concepts

Week 2 done.

This week wasn't about fancy ML models or neural networks.

It was about something more fundamental: building the Python muscle I'll need to debug AI code, even when Claude Code writes most of it.

New here? Read Week 1: Why I'm making this transition first.

What I Actually Did

This week I focused on the tools, not the theory:

Python fundamentals:

  • NumPy for numerical operations
  • Pandas for data manipulation
  • Matplotlib for visualizations
  • Jupyter notebooks as my workspace

AI/ML concepts I started exploring:

  • Embeddings (turning text into numbers)
  • Prompt engineering basics
  • Tool calling with LLMs
  • Basic LLM API calls through notebooks

Not glamorous. But necessary.

The Realization: I Need to Read AI Code, Not Just Generate It

Here's what hit me this week.

I've been using Claude Code to build POCs 2-3x faster. That's great.

But when something breaks? When the generated code doesn't do what I expect? When I need to understand WHY it works?

I need to read Python.

Not just generate it. Not just copy-paste it. Actually understand what's happening.

Coming from 18 years in other languages, I could've skipped Python basics. "It's just another language, I'll figure it out."

Bad idea.

Jupyter Notebooks: I Was Wrong

I was skeptical.

"Why not just use .py files like a normal engineer?"

Then I actually used notebooks for a week.

What clicked:

Write code → Run cell → See output immediately.

No "run entire script and wait."
No "add print statements everywhere to debug."
No "recompile everything for one change."

# Cell 1: Load data
import pandas as pd
data = pd.read_csv('data.csv')
data.head()  # See it immediately

# Cell 2: Try something
result = data['column'].mean()
print(result)  # Instant feedback

# Cell 3: Visualize
import matplotlib.pyplot as plt
data['column'].hist()
plt.show()  # Plot appears inline
Enter fullscreen mode Exit fullscreen mode

For exploration, this is perfect.

For production code, I'll still use .py files.

But for learning ML? Notebooks make sense.

NumPy, Pandas, Matplotlib: The Foundation

NumPy - operations on arrays of numbers:

import numpy as np

# Instead of loops
data = np.array([1, 2, 3, 4, 5])
doubled = data * 2  # [2, 4, 6, 8, 10]

# Fast. Clean. No explicit loops.
Enter fullscreen mode Exit fullscreen mode

This is the foundation. Every ML library uses NumPy under the hood.

Pandas - data manipulation:

import pandas as pd

# Like SQL, but in Python
df = pd.DataFrame({'age': [25, 30, 35], 'salary': [50000, 60000, 70000]})
high_earners = df[df['salary'] > 55000]
Enter fullscreen mode Exit fullscreen mode

After years of SQL and data pipelines, Pandas clicked fast.

It's what feeds data into ML models.

Matplotlib - seeing what the data looks like:

import matplotlib.pyplot as plt

plt.scatter(df['age'], df['salary'])
plt.xlabel('Age')
plt.ylabel('Salary')
plt.show()
Enter fullscreen mode Exit fullscreen mode

Turns out visualizing data isn't optional in ML. It's how you understand what's actually happening.

Starting to Understand AI Concepts

This week I dipped into actual AI/ML concepts:

Embeddings:

The idea: convert text into numbers (vectors) that capture meaning.

from sentence_transformers import SentenceTransformer

model = SentenceTransformer('all-MiniLM-L6-v2')

texts = ["distributed systems", "microservices", "machine learning"]
embeddings = model.encode(texts)

# Each text is now a 384-dimensional vector
# Similar meanings = similar vectors
Enter fullscreen mode Exit fullscreen mode

I can USE this now. Do I understand HOW the model creates these vectors?

Not yet. That's future weeks.

Prompt Engineering & Tool Calling:

Started experimenting with LLM APIs in notebooks.

Followed OpenAI's documentation examples to make basic API calls:

import openai

client = openai.OpenAI()
response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[{"role": "user", "content": "Explain embeddings simply"}]
)

print(response.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

Not building anything production-ready yet. Just understanding the mechanics.

But this shift - from using AI through a chat interface to calling it programmatically - matters.

This is the foundation of building AI applications, not just using them.

What's Still Fuzzy

How embeddings actually work: I can use them. Don't understand the training process yet.

Mathematical foundations: Linear algebra, probability - I know I need these. Haven't dived deep yet.

When to use what: Lots of ML concepts flying around. Don't have mental models yet for "when would I use X vs Y?"

That's okay. It's week 2.

The Claude Code Insight

Here's why this week mattered.

Claude Code generates Python. Fast.

But when that code uses NumPy array slicing I don't understand? Or Pandas operations I've never seen? Or tries to fix a bug I can't diagnose?

I'm stuck.

This week was about building enough Python muscle to:

  • Read what Claude generates
  • Understand what it's doing
  • Debug when it's wrong
  • Modify when I need something different

Not about becoming a Python expert.

About being competent enough to work WITH the AI tools, not just be dependent on them.

Connection to My Background

Something I noticed: ML data preparation is just ETL.

Extract, Transform, Load - but for models instead of databases.

# Load data (Extract)
data = pd.read_csv('data.csv')

# Clean and transform (Transform)
data = data.dropna()
data['new_feature'] = data['col1'] / data['col2']

# Feed to model (Load)
model.fit(data)
Enter fullscreen mode Exit fullscreen mode

I've spent 18 years building large-scale distributed systems, streaming APIs, backend infrastructure.

The last few years leading teams building data pipelines.

ML preprocessing? It's the same ETL pattern I know. Different destination.

That helped it click.

Time Investment

This week: ~12 hours

Mostly:

  • Practicing Python in notebooks
  • Working through NumPy/Pandas basics
  • Playing with embeddings
  • First LLM API calls

More hands-on than Week 1. Less "watching tutorials," more "writing code and breaking things."

Week 2 down. Building the muscle I'll actually need.


If you're also learning Python for AI/ML - what tripped you up coming from other languages?




---
Enter fullscreen mode Exit fullscreen mode

Top comments (0)