Yes, but are these electromagnets? How strong do they have to be? How long do you have to apply the magnet? For tapes, you use an electromagnet, holding it against the tape and moving it around in a circular motion, right? But will this work through the computer case itself? Or do you have to take the hard drive out and zap it?
Do you see what I'm saying? You would first have to find out the answers, then test it out to make sure it works, then when the cops are banging on the door you have to get to the computer and do the magnet. Even if it works, I don't think it's very practical.
The software that erases the hard drive must write stuff to the drive over and over so that they can't recover it through the latent magnetic signature of the data. This takes hours. Some cops might be so stupid as to believe it if you tell them that they have to let your software run until it's done, otherwise the hard drive will be damaged and they won't get any data, but others might just yank the plug out of the wall and take the computer.
Really, really good encryption might be a good answer to storing stuff on your hard drives (if you really have to keep it). Every time there's an advance, you have to keep up with it, and the cops won't be able to spend the resources figuring out what's in your encrypted files.
I think all this high-level stuff applies only to the few people who could really be busted bad (dealers, manufacturers, importers). The cops won't go through the effort just for personal use, especially if they already have the drugs they took from you. If you're just a user, don't keep shit on your computer that they can find if they grab it, it's as simple as that.
Online backup like groovee said sounds good, too, but I wouldn't trust it for very sensitive stuff or if it's data they'll try real hard to find.