Class 12 IP Practical Answers Programmer Style
Class 12 IP Practical Answers Programmer Style
#2. Given a Series, print all the elements that are above the 75th percentile.
#3. Create a DataFrame quarterly sales where each row contains the item category,
item name, and expenditure. Group the rows by the category, and print the total expenditure per
category.
#1. Answer:
```python
import pandas as pd
import numpy as np
series_from_dict = pd.Series(data_dict)
series_from_ndarray = pd.Series(data_ndarray)
print(series_from_dict)
print(series_from_ndarray)
```
#2. Answer:
```python
percentile_75 = series.quantile(0.75)
```
#3. Answer:
```python
df = pd.DataFrame(data)
grouped = df.groupby('Category')['Expenditure'].sum()
print(grouped)
```