摘要:
对HDFS 上的文件,采用绝对路径,来读取获得 RDD: In [102]: mydata=sc.textFile("file:/home/training/test.txt")17/09/24 06:31:04 INFO storage.MemoryStore: Block broadcast_3 阅读全文
摘要:
map 就是对一个RDD的各个元素都施加处理,得到一个新的RDD 的过程 [training@localhost ~]$ cat names.txtYear,First Name,County,Sex,Count2012,DOMINIC,CAYUGA,M,62012,ADDISON,ONONDAGA 阅读全文
摘要:
In [80]: class MyClass001: ....: def selfDemo(self): ....: print 'My Demo' ....: In [81]: p = MyClass001() In [82]: p.selfDemo()My Demo In [83]: In [8 阅读全文
摘要:
函数定义: In [78]: def printme(str): ....: print str ....: return ....: 调用: In [79]: printme('This is Jian')This is Jian In [80]: 阅读全文
摘要:
In [75]: x=4 In [76]: y=1 In [77]: str(bin(x ^ y))[2:].count('1') Out[77]: 2 In [78]: 来自:https://leetcode.com 阅读全文
摘要:
Practice makes perfect 发音被儿子鄙视了。需要加强练习 以此自勉。 阅读全文
摘要:
In [57]: name = ('Tome','Rick','Stephon') In [58]: age = (45,23,55) In [59]: for a,n in zip (name,age): ....: print a,n ....: Tome 45Rick 23Stephon 55 阅读全文
摘要:
Spark(Python) 从内存中建立 RDD 的例子: myData = ["Alice","Carlos","Frank","Barbara"]myRdd = sc.parallelize(myData)myRdd.take(2) In [52]: myData = ["Alice","Car 阅读全文