I have a dataset looking like this for simplication:
lst = [
["2015", "A"],
["2015", "B"],
["2015", "C"],
["2016", "A"],
["2016", "A"],
["2016", "B"],
["2016", "D"]
]
df = pd.DataFrame(lst, columns =["Year", "Item"])
I want to generate some stats like the following. How can I do this using Pandas? My actual dataset has tens of thousands of observations, and many different items.
Thank you!

