It shows up as "W" and doesn't affect your GPA, but will it look bad for grad school?
No. Universities know there are plenty of reasons one might need to drop out of a class, most of which having nothing to do with your academic abilities.
Look at yourself the way a grad school admissions office would: your GPA, test scores, research experience, letters of recommendation.
If you're a borderline candidate, it won't look good to have a lot of Ws on your transcript. If you're a strong candidate, one (maybe two) won't have much of an effect.
Separate names with a comma.