I think a single nice looking female going alone swimming in any country in the world (and I've been to 65+ of them) is inviting trouble...NOT "asking for it", mind, but inviting it all the same. As a male in my before life I wouldn't do that alone in a lot of places; transgender or single lady, nuh uh. It is sadly the way it is. Once again, not the way things should be.... you should be able to walk alone down any street at any time of day and feel and be safe, but unfortunately this is rarely the case. Another way to put it, when you went swimming alone at night, did you see any other females having a dip at that time? Alone? If you didn't, I'd be questioning why I was doing it, what they knew that I did not...
In terms of safety, again from traveling the world, it is vastly easier to avoid trouble than it is to defuse it. At 6 ft and trained in tae kwon do, safety didn't use to be a big deal to me--nobody would have wanted a piece of what I could dish out--but that was the old days before every sucker had a gun, random pack stompings for Youtube fame became a thing to do, and of course, years of HRT shrinking my muscles and making me a bit obviously different. If you are the only single girl in any given setting, ask yourself why.
Oh, protip, aka what I tell my shorty cisfemale partner (one of them, anyway:) is if you need to strike, nothing and I mean NOTHING beats a quick jumping headbutt under your attacker's chin. Basically, bend your knees, tuck your chin down (look at your feet) and spring up under his face. They never expect you to come toward them instead of tugging away, and that tap on the top of your head won't hurt anywhere near as bad as the feeling dude will have with a busted chin as he tries to spit out pieces of his own tongue.