Page 50 - IPP-12-2025
P. 50

co2 = input("Enter new Co2: ")

                               air_quality = input("Enter new Air Quality: ")

                               dfair.loc[row_index] = [temp, humidity, no2, co2, air_quality]
                               print("Data successfully updated.")

                           elif ch4 == 4:

                               break

                   elif ch == 5:

                       while True:
                           print("Working on Columns Menu")

                           print("1. Insert a new column data")

                           print("2. Delete a specific column")

                           print("3. Exit")

                           ch5 = int(input("Enter choice: "))

                           if ch5 == 1:
                               col_name = input("Enter new column name: ")

                               default_value = input("Enter default value for the new column:
               ")

                               dfair[col_name] = default_value
                               print("Column successfully inserted.")

                           elif ch5 == 2:

                               col_name = input("Enter column name to delete: ")

                               dfair.drop(columns=[col_name], inplace=True)

                               print("Column successfully deleted.")
                           elif ch5 == 3:

                               break

                   elif ch == 6:

                       while True:

                           print("Search Menu")
                           print("1. Search for the details of a specific row")

                           print("2. Search details of a specific column")

                           print("3. Exit")
   45   46   47   48   49   50   51   52   53   54   55