摘要: <dependencies> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-scala_2.11</artifactId> <version>1.7.2</version> </dependency> <depe 阅读全文
posted @ 2019-12-06 11:05 大牛和小白 阅读(3499) 评论(0) 推荐(0)
摘要: # 从mysql读数据 import pymysqlimport pandas as pddb = pymysql.connect(host="127.0.0.1", port=3306, user="root", passwd="密码", database='数据库名', charset='utf 阅读全文
posted @ 2019-12-02 14:47 大牛和小白 阅读(1279) 评论(0) 推荐(0)
摘要: 代码: from pyspark import SparkConf, SparkContextconf = SparkConf().setAppName("wordcount").setMaster("local[2]")sc = SparkContext(conf=conf)sc.setLogLe 阅读全文
posted @ 2019-12-02 14:02 大牛和小白 阅读(2514) 评论(0) 推荐(0)
摘要: 代码:import numpy as npimport pandas as pd# numpy方式data = np.loadtxt('1.txt', delimiter=',') # 读取数据文件X = data[:, 0]Y = data[:, 1]corr = np.corrcoef(X, Y 阅读全文
posted @ 2019-12-02 12:28 大牛和小白 阅读(3745) 评论(0) 推荐(0)
摘要: import org.apache.log4j.{Level, Logger}import org.apache.spark.sql.SparkSessionobject SparkSql { def main(args: Array[String]): Unit ={ Logger.getLogg 阅读全文
posted @ 2019-12-02 12:17 大牛和小白 阅读(1695) 评论(0) 推荐(0)
摘要: 代码: import org.apache.log4j.{Level, Logger}import org.apache.spark.{SparkConf, SparkContext}object WorldCount { def main(args: Array[String]): Unit ={ 阅读全文
posted @ 2019-12-02 12:08 大牛和小白 阅读(253) 评论(0) 推荐(0)
摘要: <dependencies> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>2.11.8</version> </dependency> <dependen 阅读全文
posted @ 2019-12-02 12:01 大牛和小白 阅读(1943) 评论(0) 推荐(0)
摘要: object HelloWorld { def main(args: Array[String]): Unit ={ print("HelloWorld") }} 阅读全文
posted @ 2019-12-02 11:51 大牛和小白 阅读(881) 评论(0) 推荐(0)