genre_horror genre_musical genre_mystery genre_romance genre_sci-fi genre_thriller genre_war genre_western name for much larger datathis method of constructing indicator variables with multiple membership is not especially speedy lower-level function leveraging the internals of the dataframe could certainly be written useful recipe for statistical applications is to combine get_dummies with discretization function like cutin [ ]values np random rand( in [ ]values out[ ]array( ] in [ ]bins [ in [ ]pd get_dummies(pd cut(valuesbins)out[ ]( ( ( ( ( string manipulation python has long been popular data munging language in part due to its ease-of-use for string and text processing most text operations are made simple with the string object' built-in methods for more complex pattern matching and text manipulationsregular expressions may be needed pandas adds to the mix by enabling you to apply string and regular expressions concisely on whole arrays of dataadditionally handling the annoyance of missing data string manipulation www it-ebooks info