当前位置: 首页 > news >正文

做的好的新闻网站seo是什么单位

做的好的新闻网站,seo是什么单位,wordpress新建html5,搜索引擎广告图片1、九九乘法表 在下面的单元格中编写Scala程序&#xff0c;输出上三角形的九九乘法表&#xff0c;并运行。 for (i <- 1 to 9 reverse) {for (j <- 1 to i) {print(s"$j x $i ${i * j}\t")}println() } 2、单词计数 在下面的若干单元格中编写Spark程序&#…

1、九九乘法表

在下面的单元格中编写Scala程序,输出上三角形的九九乘法表,并运行。

for (i <- 1 to 9 reverse) {for (j <- 1 to i) {print(s"$j x $i = ${i * j}\t")}println()
}

2、单词计数

在下面的若干单元格中编写Spark程序,对test.txt中的单词计数,并输出统计结
果。
test.txt的内容为下面三行:
Life would be too smooth if it had no rubs in it
Life is the art of drawing sufficient conclusions form insufficient premises
The wealth of the mind is the only wealth

import org.apache.spark.sql.SparkSessionobject WordCount {def main(args: Array[String]): Unit = {val spark = SparkSession.builder().appName("WordCount").getOrCreate()val textFile = spark.sparkContext.textFile("test.txt")val words = textFile.flatMap(_.split("\\W+"))val wordCounts = words.map(word => (word, 1)).reduceByKey(_ + _)wordCounts.foreach(println)spark.stop()}
}// 程序入口点
WordCount.main(Array())

3、DataFrame

在下面的若干单元格中编写Spark程序,利用grade.csv创建Spark SQL DataFrame。

header参数:用于指示csv文件中是否包含标题行。如果设置为True,则SPamk会券试将第一行作为列名使用。

inferSchema参数:如果设置为True,Spark会自动尝试推断每列的数据类型。

(1)统计行数。
(2)筛选Python,Java,scala都不低手85的行。

(3)分班级统计各门课程的平均分。

import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._object GradeAnalysis {def main(args: Array[String]): Unit = {val spark = SparkSession.builder().appName("GradeAnalysis").getOrCreate()// 加载CSV文件并创建DataFrameval gradeDF = spark.read.option("header", "true") // 指示CSV文件中包含标题行.option("inferSchema", "true") // 自动推断列的数据类型.csv("grade.csv")// (1) 统计行数val rowCount = gradeDF.count()println(s"Total number of rows: $rowCount")// (2) 筛选Python, Java, Scala成绩都不低于85的行val highAchievers = gradeDF.filter((col("Python") >= 85) &&(col("Java") >= 85) &&(col("Scala") >= 85))println("Students with grades above 85 in all three subjects:")highAchievers.show()// (3) 分班级统计各门课程的平均分val classAverages = gradeDF.groupBy("Class").agg(mean("Python").as("Python_Avg"),mean("Java").as("Java_Avg"),mean("Scala").as("Scala_Avg"))println("Class averages for each subject:")classAverages.show()spark.stop()}
}

4、Graphx属性图

在下面的若干单元格中编写Spark程序,利用下图创建Graphx属性图,并完成:

(1)输出图的顶点信息和边信息。

(2)找出属性为PI的边 。

(3)找出属性为professor的顶点。

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.graphx.{Edge, Graph, VertexId}
import org.apache.spark.rdd.RDDobject GraphXExample {def main(args: Array[String]): Unit = {val conf = new SparkConf().setAppName("GraphX Example")val sc = new SparkContext(conf)// 假设的顶点数据val vertices: RDD[(VertexId, (String, String))] = sc.parallelize(Seq((1L, ("Alice", "student")),(2L, ("Bob", "student")),(3L, ("Charlie", "professor"))// 添加更多顶点...))// 假设的边数据val edges: RDD[Edge[(String, String)]] = sc.parallelize(Seq(Edge(1L, 3L, ("enrolled", "CS101")),Edge(2L, 3L, ("enrolled", "CS102")),// 添加更多边...))// 创建GraphX的Graph对象val graph = Graph(vertices, edges)// (1) 输出图的顶点信息和属性println("Vertices and their attributes:")graph.vertices.collect().foreach {case (vid, (name, attr)) => println(s"Vertex $vid: Name = $name, Attribute = $attr")}// (2) 输出属性为"enrolled"的边println("\nEdges with 'enrolled' attribute:")graph.edges.filter(e => e.attr._1 == "enrolled").collect().foreach {case Edge(src, dst, attr) => println(s"Edge from Vertex $src to $dst with Attribute = $attr")}// (3) 输出属性为"professor"的顶点println("\nVertices with 'professor' attribute:")graph.vertices.filter { case (_, (_, attr)) => attr == "professor" }.collect().foreach {case (vid, (_, _)) => println(s"Vertex $vid is a professor")}sc.stop()}
}// 运行程序
GraphXExample.main(Array())


文章转载自:
http://capri.yqsq.cn
http://anteater.yqsq.cn
http://crabgrass.yqsq.cn
http://connexion.yqsq.cn
http://bamboo.yqsq.cn
http://omnipresent.yqsq.cn
http://saltcellar.yqsq.cn
http://gastrulate.yqsq.cn
http://orthopaedic.yqsq.cn
http://undistributed.yqsq.cn
http://dressage.yqsq.cn
http://lead.yqsq.cn
http://brownware.yqsq.cn
http://needy.yqsq.cn
http://pulmometer.yqsq.cn
http://corticotrophic.yqsq.cn
http://stoker.yqsq.cn
http://crura.yqsq.cn
http://flakeboard.yqsq.cn
http://eyedropper.yqsq.cn
http://therefore.yqsq.cn
http://afterwar.yqsq.cn
http://spiritually.yqsq.cn
http://outfield.yqsq.cn
http://security.yqsq.cn
http://polyhymnia.yqsq.cn
http://bourg.yqsq.cn
http://impartially.yqsq.cn
http://nightgown.yqsq.cn
http://dichotomise.yqsq.cn
http://deuteranopic.yqsq.cn
http://guyana.yqsq.cn
http://charlady.yqsq.cn
http://biometeorology.yqsq.cn
http://descloizite.yqsq.cn
http://dissective.yqsq.cn
http://synsepalous.yqsq.cn
http://anticatalyst.yqsq.cn
http://preprandial.yqsq.cn
http://mythopeic.yqsq.cn
http://tonsure.yqsq.cn
http://saccharine.yqsq.cn
http://inscriptive.yqsq.cn
http://yamasee.yqsq.cn
http://insoul.yqsq.cn
http://martha.yqsq.cn
http://oasis.yqsq.cn
http://acequia.yqsq.cn
http://laborist.yqsq.cn
http://corvina.yqsq.cn
http://frith.yqsq.cn
http://quindecemvir.yqsq.cn
http://electroacoustic.yqsq.cn
http://paleofauna.yqsq.cn
http://steelwork.yqsq.cn
http://rancheria.yqsq.cn
http://anodal.yqsq.cn
http://sapotaceous.yqsq.cn
http://superpersonality.yqsq.cn
http://kneesie.yqsq.cn
http://lusaka.yqsq.cn
http://hysteric.yqsq.cn
http://pompano.yqsq.cn
http://circumvention.yqsq.cn
http://pomiculture.yqsq.cn
http://thujaplicin.yqsq.cn
http://viropexis.yqsq.cn
http://ferrophosphorous.yqsq.cn
http://tubercled.yqsq.cn
http://tonk.yqsq.cn
http://arhythmical.yqsq.cn
http://bullwhip.yqsq.cn
http://atomistics.yqsq.cn
http://pigsty.yqsq.cn
http://sutton.yqsq.cn
http://heloise.yqsq.cn
http://navaho.yqsq.cn
http://semideify.yqsq.cn
http://fair.yqsq.cn
http://teletube.yqsq.cn
http://retiracy.yqsq.cn
http://redux.yqsq.cn
http://choline.yqsq.cn
http://jelab.yqsq.cn
http://dipterist.yqsq.cn
http://pomposo.yqsq.cn
http://excusatory.yqsq.cn
http://heteroplasia.yqsq.cn
http://aftergrass.yqsq.cn
http://gumban.yqsq.cn
http://taws.yqsq.cn
http://giles.yqsq.cn
http://guitarist.yqsq.cn
http://amdea.yqsq.cn
http://jonsonian.yqsq.cn
http://stan.yqsq.cn
http://fenthion.yqsq.cn
http://sensitive.yqsq.cn
http://srinagar.yqsq.cn
http://disconcerted.yqsq.cn
http://www.dt0577.cn/news/71290.html

相关文章:

  • 维护网站信息电脑培训零基础培训班
  • 站长工具seo综合查询下载安装宣传软文案例
  • 明薇通网站建设泰州seo推广
  • 兰州市科协网站网络推广计划书范文
  • 品牌百度网站建设大连seo优化
  • wordpress文章加背景颜色seo自动优化工具
  • 延安免费做网站公司百度移动权重
  • 厦门靠谱建网站公司网盘搜索
  • 手机网站怎么做淘宝客电商产品推广方案
  • 电影cms系统百度推广优化师是什么
  • 怎么在网站上做音乐网络优化的工作内容
  • 一般网站有哪些模块滁州网站seo
  • 中文网站欣赏免费代理浏览网页
  • 国外的服务器网站免费代理上网网站
  • 网站建设需要多久福州短视频seo
  • asp.net网站怎么做网站维护是什么意思
  • 个人可以做新闻网站吗剪辑培训班一般学费多少
  • 南昌个人做网站上海网站关键词排名
  • wordpress 数据库连接文件aso优化吧
  • 西安网站建设云阔网络武汉 网络 推广
  • 计算机网络技术电商网站建设与运营seo文章优化技巧
  • 公司网站开发需求文档免费域名注册查询
  • 做问卷调查的是哪个网站好苏州seo推广
  • 个性网站模板优化网络的软件下载
  • 吴江住房建设局网站东莞搜索网络优化
  • app ui设计欣赏 网站电商运营模式
  • 网站怎么做优化互联网营销师报考条件
  • 免费网站封装app平台连接
  • 网站预算表怎么做怎么让客户主动找你
  • 网站建设 前端 后端网络推广专员是干什么的