04 2021 档案
摘要:一、词频统计: 1.读文本文件生成RDD lines >>> lines = sc.textFile('file:///home/hadoop/word.txt') 2.将一行一行的文本分割成单词 words flatmap() >>> words=lines.flatMap(lambda line
阅读全文
摘要:import operator import os #打开文件 speech_text='' try: f = open(os.path.abspath('text.txt'),'r') speech_text = f.read() f.close() except: print("File Ope
阅读全文
摘要:一、词频统计: 1.读文本文件生成RDD lines 2.将一行一行的文本分割成单词 words flatmap() lines=sc.textFile("file:///usr/local/spark/mycode/wordcount/word.txt") words = lines.flatMa
阅读全文

浙公网安备 33010602011771号