ValueError: negative dimensions are not allowed using pandas pivot_table
问题 I am trying to make item-item collaborative recommendation code. My full dataset can be found here. I want the users to become rows, items to become columns, and ratings to be the values. My code is as follows: import pandas as pd import numpy as np file = pd.read_csv("data.csv", names=['user', 'item', 'rating', 'timestamp']) table = pd.pivot_table(file, values='rating', index=['user'], columns=['item']) My data is as follows: user item rating timestamp 0 A2EFCYXHNK06IS 5555991584 5 978480000