def movie_body_count_r_classify(data_set='<STR_LIT>'):
data = movie_body_count()['<STR_LIT:Y>']<EOL>import pandas as pd<EOL>import numpy as np<EOL>X = data[['<STR_LIT>', '<STR_LIT>']]<EOL>Y = data['<STR_LIT>']=='<STR_LIT:R>' <EOL>s = data['<STR_LIT>'].str.split('<STR_LIT:|>').apply(pd.Series, <NUM_LIT:1>).stack()<EOL>s.index = s.index.droplevel(-<NUM_LIT:1>) <EOL>genres = s.unique()<EOL>for genre in genres:<EOL><INDENT>index = s[s==genre].index.tolist()<EOL>values = pd.Series(np.zeros(X.shape[<NUM_LIT:0>]), index=X.index)<EOL>values[index] = <NUM_LIT:1><EOL>X[genre] = values<EOL><DEDENT>return data_details_return({'<STR_LIT:X>': X, '<STR_LIT:Y>': Y, '<STR_LIT:info>' : "<STR_LIT>",<EOL>}, data_set)<EOL>
Data set of movies and body count for movies scraped from www.MovieBodyCounts.com created by Simon Garnier and Randy Olson for exploring differences between Python and R.