a guest Jan 20th, 2020 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Zależność pomiędzy liczbą wypadków a warunkami pogodowymi
  2. val pogoda_pom_DS = pogoda_DS.withColumnRenamed("id", "pog_id").
  3.   withColumnRenamed("nazwa", "pogoda").
  4.   select("pog_id", "pogoda")
  5. val analiza4_DS = wypadki_DS.
  6.   join(pogoda_DS, $"id_weather" === $"pog_id").
  7.   groupBy("pogoda").
  8.   agg(sum("Accidents_Count").as("liczba_wypadkow").
  9.   select("pogoda", "liczba_wypadkow")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand