So I graduated May of 2017
I joined a coding bootcamp. I am about to graduate.
While not important, it is still confusing ;)
Back to the subject: I think you should not worry much about it. Things like this may happen. Considering that you are quite fresh after college, it may not even weigh much with interviewers / companies - even if they will remark this and talk to you about this. It is their job to make you as insecure as possible.
To "defend" yourself if needed, you can go simple. Tell them the truth, that you understood that software is more attractive than electrical engineering, and that you are happy to enlarge your knowledge in different fields.
Also tell them that the job at that company was not what you expected - it did not involve writing software - and that it was natural to move on.
On the other hand, even if it not always possible, no not leave one job before you have another one - with all details clarified (e.g. how much time you will spend writing software, which activities of software development you will do...) and with signed contract.