0
0
Data Analysis Pythondata~30 mins

Series creation from lists and dicts in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
Series creation from lists and dicts
📖 Scenario: You work in a small shop and want to organize your sales data. You have sales numbers and product names in simple lists and dictionaries. You want to turn these into a pandas.Series to analyze them easily.
🎯 Goal: Create pandas.Series from a list and a dictionary. Learn how to set custom indexes and see the data clearly.
📋 What You'll Learn
Use pandas.Series to create series from lists and dictionaries
Set custom index labels for the series
Print the series to see the output
💡 Why This Matters
🌍 Real World
Organizing sales data in a Series helps you quickly analyze monthly sales or product sales in a simple, readable format.
💼 Career
Data analysts and scientists often convert raw data from lists or dictionaries into Series for easy data manipulation and analysis.
Progress0 / 4 steps
1
Create a list of sales numbers
Create a list called sales with these exact numbers: 100, 200, 300, 400, 500.
Data Analysis Python
Need a hint?

Use square brackets [] to create a list with the numbers separated by commas.

2
Create a Series from the sales list with custom index
Import pandas as pd. Then create a pandas.Series called sales_series from the list sales. Use the index labels 'Jan', 'Feb', 'Mar', 'Apr', 'May' for the series.
Data Analysis Python
Need a hint?

Use pd.Series(data, index=[...]) to create the series with custom index labels.

3
Create a dictionary of product sales
Create a dictionary called product_sales with these exact entries: 'apple': 50, 'banana': 75, 'orange': 100.
Data Analysis Python
Need a hint?

Use curly braces {} to create a dictionary with key-value pairs separated by colons.

4
Create a Series from the product_sales dictionary and print both series
Create a pandas.Series called product_series from the dictionary product_sales. Then print both sales_series and product_series.
Data Analysis Python
Need a hint?

Use pd.Series() with a dictionary to create the series. Use print() to show the series.