Skip to content

Instantly share code, notes, and snippets.

@bryanyang0528
Created October 9, 2014 16:57
Show Gist options
  • Select an option

  • Save bryanyang0528/eb6ab4b750feaeb7525b to your computer and use it in GitHub Desktop.

Select an option

Save bryanyang0528/eb6ab4b750feaeb7525b to your computer and use it in GitHub Desktop.
In [5]:
raw_ratings = sc.textFile('/Users/bryanyang/Documents/Data/Movie Rating/ratings.dat',10) ##分成10份
raw_ratings.setName("raw ratings 10")
raw_ratings.cache()
Out[5]:
raw ratings 10 MappedRDD[6] at textFile at NativeMethodAccessorImpl.java:-2
In [6]:
entries = raw_ratings.count()
print "%s entries in ratings" %entries
Out[6]
100000 entries in ratings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment