def manipulate_values(): selected = data_list.curselection() if selected: dataset_name = data_list.get(selected[0]) df = data_dict.get(dataset_name) if df is not None: try: # Get user input for the column and the new range column_name = simpledialog.askstring("Input", "Enter the column name you want to manipulate") min_value = simpledialog.askfloat("Input", "Enter the minimum value for the range") max_value = simpledialog.askfloat("Input", "Enter the maximum value for the range") # Filter the data frame df = df[df[column_name].between(min_value, max_value)] # Save the updated DataFrame back to data_dict data_dict[dataset_name] = df # Update the preview check_dataset_selected() messagebox.showinfo("Success", "Values manipulated successfully") except Exception as e: messagebox.showerror("Error", str(e)) else: messagebox.showinfo("Error", "No data selected") else: messagebox.showinfo("Error", "No dataset selected")