sds2019 icon indicating copy to clipboard operation
sds2019 copied to clipboard

Assignment 1 - Problem 6.1.4

Open EMCK3N opened this issue 5 years ago • 4 comments

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.

EMCK3N avatar Aug 16 '19 14:08 EMCK3N

Can you share the code you use to create the dataset?

kristianolesenlarsen avatar Aug 16 '19 15:08 kristianolesenlarsen

path = "https://www1.ncdc.noaa.gov/pub/data/ghcn/daily/by_year/1864.csv.gz" df = pd.read_csv(path, sep=',',header=None)

EMCK3N avatar Aug 16 '19 15:08 EMCK3N

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)

EMCK3N avatar Aug 16 '19 15:08 EMCK3N

Disregard, i found that you have uploaded a weather.csv file, with the assignment.

EMCK3N avatar Aug 16 '19 16:08 EMCK3N