#-*-coding:utf-8-*-"""Created on Thu Sep 12:24:37 2017@author:douzi"""ImportPandas as PD#User InformationUnames = ['user_id','Gender',' Age','Occupation','Zip']users= Pd.read_table ('Ch02/movielens/users.dat', sep='::', Header=none, Names=unames, engine='python')#Movie RankingsRnames = ['user_id','movie_id','rating','timestamp']ratings= Pd.read_table ('Ch02/movielens/ratings.dat', sep='::', Header=none, names=rnames,engine='python')#Movie InformationMnames = ['movie_id','title','Genres']movies= Pd.read_table ('Ch02/movielens/movies.dat', sep='::', Header=none, Names=mnames, engine='python') users[:5]out[113]: user_id gender age occupation Zip01 F 1 480671 2 m 700722 3 m 25 15 551173 4 M 7 024604 5 m 25 20 55455ratings[:5]out[114]: user_id movie_id rating Timestamp01 1193 5 9783007601 1 661 3 9783021092 1 914 3 9783019683 1 3408 4 9783002754 1 2355 5 978824291movies[:5]out[115]: movie_id title Genres01 Toy Story (1995) animation| Children's| Comedy1 2 Jumanji (1995) adventure| Children's| Fantasy2 3 Grumpier Old Men (1995) comedy|Romance3 4 Waiting to Exhale (1995) comedy|Drama4 5 Father of the Bride Part II (1995) Comedy
Data analysis by Python (ii) initial study 2