Page 76 - IPP-12-2025
P. 76

print("2. Forest fire detections in 2022-2023")
                          print("3. Exit")
                          chhist = int(input("Enter choice: "))
                          if chhist == 1:
                              if 'Nov 2021 to June 2022' in result.columns:
                                 plt.hist(result['Nov 2021 to June 2022'], bins=5,
                                 label="2021-2022", color="green", edgecolor="black")
                                 plt.title("Histogram of Fire Detections (2021-2022)")
                                 plt.xlabel("Fire Detections")
                                 plt.ylabel("Frequency")
                                 plt.legend()
                                 plt.show()
                              else:
                                 print("Column not found.")
                          elif chhist == 2:
                              if 'Nov 2022 to June 2023' in result.columns:
                                 plt.hist(result['Nov 2022 to June 2023'], bins=5,
                                 label="2022-2023", color="yellow", edgecolor="black")
                                 plt.title("Histogram of Fire Detections (2022-2023)")
                                 plt.xlabel("Fire  Detections")
                                 plt.ylabel("Frequency")
                                 plt.legend()
                                 plt.show()
                              else:
                                 print("Column not found.")
                          elif chhist == 3:
                              break
                          else:
                              print("Invalid choice. Please try again.")
                    elif ch7 == 5:
                       break
               elif ch == 8:
                  while True:
                    print("\nData Analytics Menu")
                    print("1. State/UT with maximum fire detections (Nov 2021 to June 2022)")
                    print("2. State/UT with minimum fire detections (Nov 2021 to June 2022)")
                    print("3. State/UT with maximum fire detections (Nov 2022 to June 2023)")
                    print("4. State/UT with minimum fire detections (Nov 2022 to June 2023)")
                    print("5. Exit")
                    chana = int(input("Enter choice: "))
                    if chana == 1:
                       max_detections_2021 = result['Nov 2021 to June 2022'].max()
                       state_max_2021 = result.loc[result['Nov 2021 to June 2022'] == max_
                       detections_2021]
                       print("State/UT with maximum fire detections in Nov 2021 to June
                       2022({max_detections_2021}detections):\n", state_max_2021.index)
                       print(state_max_2021[['State/UT']])
                    elif chana == 2:
                       min_detections_2021 = result['Nov 2021 to June 2022'].min()
                       state_min_2021 = result.loc[result['Nov 2021 to June 2022'] == min_
                       detections_2021]
                       print("State/UT with minimum fire detections in Nov 2021 to June 2022
                       ({min_detections_2021} detections):\n", state_min_2021.index)
                       print(state_min_2021[['State/UT']])
                    elif chana == 3:
                       max_detections_2022 = result['Nov 2022 to June 2023'].max()


              A.20
   71   72   73   74   75   76   77   78   79   80   81