By removing the uterus as well as the ovaries,
a complete ovariohysterectomy is thought to remove any chance of future uterine problems.
The best course of treatment for pyometra is to have
a complete ovariohysterectomy (spay) as recurrence is high; if you have treated medically and are wanting to breed with her, this is your decision however I generally recommend against it.
A complete ovariohysterectomy can be performed by your exotics vet on your guinea pig at about six months of age to prevent uterine and ovarian diseases just as it would in a dog or cat.