sds2019
sds2019 copied to clipboard
Assignment 1 - Problem 6.1.4
Group 20, have a question regarding the country codes in problem 6.1.4, but when i run the assert, it fails as you have fewer unique ID numbers than i do. Have you removed some of the stations?
We have 21 unique station identifiers and you only have 11.
Can you share the code you use to create the dataset?
path = "https://www1.ncdc.noaa.gov/pub/data/ghcn/daily/by_year/1864.csv.gz" df = pd.read_csv(path, sep=',',header=None)
Then i run the following code on the df weather = df.copy() weather_1864['answer_61'] = weather_1864.iloc[:,0].str.extract('([A-Z]{0,3})', expand=True) weather_1864['answer_61'].str[:3].unique()
This gives the following output. array(['ITE', 'ASN', 'USC', 'SF', 'SWE', 'USP', 'CA', 'HRE', 'EIE', 'BE', 'AGE', 'NLM', 'GME', 'NLE', 'EZE', 'SW', 'AU', 'GM', 'UK', 'HR', 'SZ'], dtype=object)
Disregard, i found that you have uploaded a weather.csv file, with the assignment.