I suppose to create a pie chart displaying the prices of the Detached, Semi-Detached, Flats, and Terraced columns for the Aberdeenshire and Angus region from a Pandas DataFrame.
The task from the paper: "Show the split in sales value between flats, terraced, detached and semi detached properties in the Aberdeenshire region using a pie chart, then show this for Angus."
Here is what I did:
import pandas as pd
from matplotlib import pyplot as plt
import matplotlib.pyplot as plt
df = pd.read_csv ('C:/Users/user/AppData/Local/Programs/Python/Python39/Scripts/uk_hpi_dataset_2021_01.csv')
sales_value = df.loc[df['RegionName'] == 'Aberdeenshire', ['DetachedPrice', 'SemiDetachedPrice', 'FlatPrice', 'TerracedPrice']]
sales_value.plot(sales_value, kind='pie', subplots=True)
However, when I try to print the result, I get four weird-looking individual lists with numbers and color codes - which I assume they meant to represent all the 'Aberdeenshire' rows in the 'RegionName' column - but not a Pie Chart. I might be close to the answer but can anyone give me a hand in turning this into an actual Pie Chart?
Any answers will be highly appreciated!