Page 59 - IPP-12-2024
P. 59

print("Data successfully updated for",
               subject_name)

                               else:
                                   print("Data entry error: The number of
               provided values does not match the DataFrame structure.")

                           elif choice==2:

                               subject_name = input("Enter subject name whose
               data needs to be deleted: ")

                               if subject_name in result.index:

                                   result.drop(index=subject_name,
               inplace=True)

                                   print("Data successfully deleted")

                               else:

                                   print("Subject not found.")

                           else:

                               continue
                       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:

                                      print("Enter details")

                                      h=input("Enter column/heading name")

                                      det=eval(input("Enter details
               corresponding to all subject:(enclosed in [ ])"))


               result[h]=pd.Series(data=det,index=result.index)

                                      print("Column inserted")

                                   elif ch5==2:
   54   55   56   57   58   59   60   61   62   63   64