Now on the laptop at home using same e-mail address (yahoo) there is no spam folder just one called junk mail or similar which never seems to get anything.
What programme are you using to access your emails at home?
If it is a web browser like Firefox, Edge or Chrome and you are using webmail to look at your emails then it should be exactly the same* as what you see in the library.
If your laptop is set up with an email programme/app like Outlook or Windows Mail then things will be different - it would only download the emails it has been set up to download, and folder names like "Spam"/"Junk" will be different.
Yahoo webmail will put items it thinks are junk into a folder called 'Spam'. That happens at the Yahoo end.
An email 'client' like Outlook will usually be set up to download everything it sees in your Inbox, it then processes the downloaded messages and moves any it thinks are junk into a 'local' junk mail folder on your computer.
That would explain why you don't get any junk at home, but it is there when you check at the library.
From what you describe it sounds like you are using an email programme/app on your laptop.
Can you confirm this by describing what you do to access your email on the laptop?
Who set the laptop up for you? Was it a friend/relative, or someone in a shop?
(*There might be minor differences due to the browser version, but it wouldn't change the name of your junk mail folder)