Create a Named Series
Intermediate · Write the code · from Pandas: Create, Load, and Explore DataFrames
From the lesson: Pandas: Create, Load, and Explore DataFrames
You have a spreadsheet with 10,000 rows of sales data. You need to find every order over $500, group them by region, and calculate the average. In Excel, that takes a pivot table, a filter, and a lot of clicking. In pandas, it takes three lines of code.
Read the lessonCreate a pandas Series called temps containing the values [72, 68, 75, 80, 77] with the name 'daily_temp'. Print the Series name using temps.name.
import pandas as pd
# Create a Series named 'daily_temp'
More Pandas DataFrame exercises
- Build a DataFrame from a DictionaryIntermediate
- DataFrame from RecordsIntermediate
- Predict the Output: head()Intermediate
- Add a Computed ColumnIntermediate
- Fix the Bug: Column SelectionIntermediate
- Extract Stats from describe()Intermediate
All Python exercises · 50 practice problems · Data Science & Machine Learning quiz