Introduction to Pandas
If NumPy is a powerful calculator, Pandas is a complete spreadsheet with programming capabilities. It's built on top of NumPy and provides labeled, structured data - exactly what we deal with in finance.
Pandas Series: Labeled Data
A Series is like a NumPy array but with labels (an index):
Adding Meaningful Labels
Pandas DataFrame: Your Financial Spreadsheet
A DataFrame is a table with rows and columns - the most important data structure for financial analysis:
Viewing Data
Accessing Columns
Adding New Columns
Practice: Create a Portfolio DataFrame
Practice: Add Weight Column
Key Takeaways
- Pandas Series = NumPy array + labels
- Pandas DataFrame = table with rows and columns
- Access columns with
df['ColumnName'] - Add columns with
df['NewColumn'] = calculation - Use
.head(),.tail(),.shapeto explore data - DataFrames make financial calculations intuitive
Next, we'll learn about filtering, sorting, and more DataFrame operations!
Up next · Lesson 11 of 26
DataFrame Operations
1 min read
10 of 26 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

