Different things have different price changes over time.
For example, in 1973 a 2N2222 transistor was $0.79 at Radio Shack.
Today, a single 2N2222 is $1.29 at Jameco. It's $0.95 at AmplifiedParts.com. It's $7 for 100 of them at Amazon.
If we go by the price of 2N2222 transistors and use the price for single units at Jameco we get inflation of 1% per year over the last 50 years.
In 1977 the price of volume I of Apostol's "Calculus" in hardback was around $20. Now it is $153 on Amazon, for the same book. By "same book" I don't just mean hardback. I also mean the same content. It was on the 2nd edition in 1977 and Apostol saw no need for any further revisions.
Using Apostol volume I as our yardstick inflation has been 4.6% per year over the last 45 years.
The most complete way to represent inflation would be as a vector whose components are the inflation for each individual good or service.
To get a scalar for inflation they take another vector that represents how much of each good or service that some hypothetical typical consumer consumes and combine them to get what the overall inflation is for a typical consumer.