text_plain_output_1.png
import pandas as pd # Manipulación y análisis de datos, Data Frames, lectura de CSV

data = pd.read_csv('../input/pageviews/pageviews.csv', parse_dates=['FEC_EVENT'])

X_test = []
for c in data.drop(['USER_ID', 'FEC_EVENT'], axis=1).columns:
    temp = pd.crosstab(data.USER_ID, data[c])
    temp.columns = [c + '_' + str(v) for v in temp.columns]
    X_test.append(temp.apply(lambda x: x / x.sum(), axis=1))
X_test = pd.concat(X_test, axis=1)

pd.crosstab(data.USER_ID, data['PAGE']).head()