Data Description:movielens DataSet, which contains 100K movie scores from 943 users and a select 1682 movies . score at least 20 movies per user, data type User ID | item ID | rating | timestamp.
Address: https://grouplens.org/datasets/movielens/
1. Introduction of Pandas,numpy Package
2, read the data: First, if the file is not in the default path, you need to change the path, using the following two lines of command, in addition to pay attention to the application of forward and reverse slashes.
OS.GETCWD ()
Os.chdir ("New Path")
3, because the data contains the scoring data, user data, but in two files, so need to merge. First, use header=[' l column name 1 ', ' Column Name 2 ' ... Format to add a column name to two files
Then the data is merged
Results:
Convert a file to a dictionary type and read two columns by column name
Python Movie Data analysis