Data analysis by Python (ii) initial study 2

Source: Internet
Author: User

#-*-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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.