Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Split pandas column and create new columns that has the count of those split values

$
0
0

I have an excel file in which one of the columns has multiple values seperated by a comma (please see the attached image)

Excel screenshot

For the StuType column, the numbers go all the way from 1 to 13 including some blank rows (as can be seen in ResponseID = 8538 and 8562).

I am reading the file into pandas. The goal is to have 13 different columns with values 0 and 1 in there. My question is very similar to this one, however, both the solutions suggested there do not work for me.

Can someone please help me? Thank you so very much!


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>