Open utterances-bot opened 3 years ago
Exercise: Determining Matches
Exercise: Minimum File Size
import glob
import pandas as pd
fewest = 100 # a large number
for filename in glob.glob('data/data_gapminder/*.csv'):
dataframe = pd.read_csv(filename)
fewest = min(fewest, dataframe.shape[0])
print('smallest file has', fewest, 'records')
Result:
smallest file has 2 records
Exercise: Comparing Data The following program works, but I don't know how to label the regions in the legend
for filename in glob.glob('data/data_gapminder/gapminder_gdp_*.csv'):
data = pd.read_csv(filename)
data.mean().plot()
plt.legend(loc='best')
plt.xticks(rotation=90)
Looping Over Data Sets — Python essentials for GIS learners
https://the-magnificents.github.io/04-02-2021-Carpentry-for-HGIS/02_Day_2_Python_GIS/exercise/B7_Exercise_Loop_Datasets.html