Sql questions Question 1



Yüklə 67,59 Kb.
səhifə4/4
tarix23.12.2023
ölçüsü67,59 Kb.
#156483
1   2   3   4
6afac0bf-38b2-49c5-88da-a3701e407493 5 puzzles

Create a New Column:

  • Create a new column 'Comfortable' in the original DataFrame (df).

  • If the temperature is greater than or equal to 25 degrees Celsius and the rainfall is less than 50mm, set 'Comfortable' to 'Yes', otherwise 'No'.

  • Summary:

    • Provide a summary of the average temperature and total rainfall for each city over the entire dataset.

    Sample data to create data frame:
    data = {'City': ['City_A', 'City_A', 'City_B', 'City_B', 'City_C', 'City_C'],
    'Month': ['January', 'February', 'January', 'February', 'January', 'February'],
    'Temperature': [20, 25, 22, 28, 18, 23],
    'Rainfall': [30, 40, 20, 50, 10, 30]}
    Yüklə 67,59 Kb.

    Dostları ilə paylaş:
  • 1   2   3   4




    Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
    rəhbərliyinə müraciət

        Ana səhifə