<jupyter_start><jupyter_text>Obtenemos los días en los que llovió, ordenados por la temperatura (de mas a menos temperatura)<jupyter_code>hottest_with_precip = spark.sql("SELECT * FROM weather WHERE Precip > 0.0 ORDER BY Temp DESC")
hottest_with_precip.show()<jupyter_output>+----+------+----+-----+---+
|Temp|Precip|Year|Month|Day|
+----+------+----+-----+---+
|  27|  7.87|2013|   07| 23|
|  27|  5.59|2013|   07| 08|
|  27|  1.27|2013|   08| 09|
|  27|  5.84|2013|   07| 09|
|  27|   6.1|2013|   06| 27|
|  27|  1.27|2013|   06| 26|
|  27|  1.52|2013|   07| 22|
|  26| 21.59|2013|   06| 02|
|  26|  0.25|2013|   09| 10|
|  26|  1.27|2013|   09| 02|
|  26|  0.25|2013|   08| 27|
|  26| 10.92|2013|   08| 28|
|  26| 40.64|2013|   09| 12|
|  26| 13.46|2013|   07| 03|
|  25|  0.25|2013|   06| 17|
|  25|  2.03|2013|   07| 02|
|  25|  0.25|2013|   07| 29|
|  24| 21.34|2013|   07| 01|
|  24| 11.68|2013|   08| 08|
|  24|  1.27|2013|   08| 12|
+----+------+----+-----+---+
only showing top 20 rows<jupyter_text>Calculamos el total de precipitaciones por mes<jupyter_code>group_by_month = spark.sql("SELECT ROUND(SUM(Precip)) AS PrepTotal, Month  FROM weather GROUP BY Month ORDER BY PrepTotal DESC")
group_by_month.show()<jupyter_output>+---------+-----+
|PrepTotal|Month|
+---------+-----+
|    257.0|   06|
|    203.0|   05|
|    108.0|   02|
|     80.0|   11|
|     80.0|   12|
|     75.0|   09|
|     73.0|   03|
|     72.0|   07|
|     72.0|   08|
|     70.0|   01|
|     33.0|   04|
|      9.0|   10|
+---------+-----+
StarcoderdataJupyterStructuredCleanDedup