isdsucph / isds2021

Introduction to Social Data Science 2021 - a summer school course https://isdsucph.github.io/isds2021/
MIT License
22 stars 37 forks source link

Final task #2

Open MieH-Dk opened 3 years ago

MieH-Dk commented 3 years ago

For the final task, are we expected to make the dataframe for each year into a smaller dataframe only consisting of the observations for maximal temperature? If so - should we sort by higest temperature? And should the dataframe consist of only data from the 'ITE00100550' station or from all of the stations?

joachimkrasmussen commented 3 years ago

Hi Mie,

I'm assuming that you are asking about exercise 0.4.6. Here, you should simply use 'df_select' from before.

Best, Joachim

MieH-Dk commented 3 years ago

Hi! No, I'm talking about Ex. 0.5.1.

joachimkrasmussen commented 3 years ago

Aha! Here you should use data from all stations, and you should not restrict your data to observations for maximal temperature.

/Joachim

johankll commented 3 years ago

Hi Joachim,

The assignment-hint says: "Don't forget to process the loaded DataFrame by using .iloc[] and changing the column names for each year as we previously did for the year 1863."

What are we exactly meant to do (i.e. what does it mean to "process the loaded DataFrame by using .iloc[])? I understand that we should modify the column-names as in Ex. 0.4.2... But should we also do any other modifications?

Also: is it necessary to use .iloc[] when changing column-names? I simply use .columns=[] which seems to work as well - am I missing something?

/Johan

joachimkrasmussen commented 3 years ago

Hi Johan,

What you are meant to do is the following:

  1. Load data for each year
  2. Keep only the first four columns for each year
  3. Rename the columns appropriately
  4. Store each data frame as an element in a joint list
  5. Create a new joint data frame from this list
  6. Reset the index

Does this make sense?

Regarding .iloc[]: It is not necessary to use .iloc[] when changing column-names. In fact, I don't think we are ever asking you to do so? Actually, using .columns=[] sounds perfectly appropriate :)

Best, Joachim

johankll commented 3 years ago

Thanks a lot, Joachim.

You do actually ask us to use .iloc[] in the exercise hint.

/Johan

joachimkrasmussen commented 3 years ago

That's for the selection of columns (preprocessing) - not the renaming of columns:)

Best, Joachim