Python: Fix csv file paths for learn site sample. Improve streaming output formatting with code present #10498
+88
−64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The code sample located here had an issue loading the resource csv files right out of the box. Additionally, the formatted output could use some help.
Now the output is formatted nicely like:
To provide a column chart of the top 10 countries by population with values at the top of each column, I'll need to examine the contents of the uploaded files. Let's first take a look at the data in these files to understand their structure and content.
The first file seems to contain regional population data for various provinces and states within countries, such as Belgium and the US. The important columns for this task are:
Country_Region
: the name of the countryPopulation
: the population of the regionThe second file provides population data by country, which seems more appropriate for finding the top 10 countries by population. It contains:
Country_Region
: the name of the countryPopulation
: the population of the countryWe'll use the second file to extract the top 10 countries by population and create a column chart with the population values displayed on top. Let's proceed with this analysis.
Description
Fix formatting and csv links for a learn resource sample.
Contribution Checklist