<filename>gti_eg_education/patches/remove_extra_gender_data.py
import frappe


def execute():
	for g in frappe.get_all("Gender", {"name": ("not in", ("Male", "Female"))}):
		frappe.delete_doc("Gender", g)

<filename>gti_eg_education/patches/remove_extra_gender_data.py
import frappe


def execute():
	for g in frappe.get_all("Gender", {"name": ("not in", ("Male", "Female"))}):
		frappe.delete_doc("Gender", g)
