Sql questions Question 1


Download 67.6 Kb.
bet4/4
Sana31.01.2024
Hajmi67.6 Kb.
#1818450
1   2   3   4
Bog'liq
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]}
    Download 67.6 Kb.

    Do'stlaringiz bilan baham:
  • 1   2   3   4




    Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
    ma'muriyatiga murojaat qiling