I like to keep three females in with a breeding boar max. We also have a sow weanling pen that max out at six, but we have to monitor it a lot. It has extra water bottles and many different feed cups and bins with lots of space to run. Sows tend to have more issues living in a group than boars do actually. I have this conversation with many people looking for a sow for a pet. Not to say all are rotten, but you get that one and it will starve everyone in the cage. Had a call a few months back about what to do with a guinea pig that attacks. Rarely do you hear about one like that, but my first question was if it was a sow. Sure enough. The sow had only been home from the pet store a few days and these were adults with no children. After all said and done I think that that particular guinea pig was put down as it also attacked other pigs back at the pet store and a couple employees. The customer in question purchased another pig from a breeder in her area that was a boar.
And with that entire history of rotten sows, I have a few precious ones here in our caviary that I love to pieces. Lost my very best one last year to old age. She was pushing 6 and had been the Grandma to our baby sows for years. Never did anything mean and always the first to come get pets, treats and be held. She loved the babies that was for sure. Gosh and addicted to yogurt too! LOL
I know that guinea pigs have and will continue to be bought as a single pet. After having so many for the last several years and knowning their herd temperments, I no longer suggest one as a single pet. Even if you are looking for same sex pairs. Just need to be prepared to let the pecking order happen. Sort of like our horses.