python与PySpark

1、Spark是Apache基金会 下的顶级开源项目,用于对海量数据经行大规模的分布式技术;

2、P有Spark是Spark的python实现,用于python中完成Spark的任务开发;

3、安装:可通过cmd终端进行安装

复制代码
pip install PySpark

也可以通过国内镜像网站,

复制代码
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspark

3、执行一个简答的程序进行验证

复制代码
# 导入 PySpark 相关包
from pyspark import SparkConf, SparkContext


conf =SparkConf().setMaster("local[*]").setAppName("test_spark_app") # 创建SparkConf对象
 # 基于SparkConf对象创建sparkcontext对象,
sc=SparkContext(conf=conf)

#打印pyspark的版本
print(sc.version)
sc.stop()

如果出现乱码,可能是jdk的问题,或者是编码问题

相关推荐
金銀銅鐵16 小时前
[Python] 从《千字文》中随机挑选汉字
后端·python
cup1120 小时前
[技术复盘] Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
python·ai·环境变量·ci·nuitka·skill
aqi001 天前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵1 天前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf1 天前
Agent 流程编排
后端·python·agent
copyer_xyf1 天前
Agent RAG
后端·python·agent
copyer_xyf1 天前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf1 天前
Agent 记忆管理
后端·python·agent
星云穿梭2 天前
用Python写一个带图形界面的学生管理系统——完整教程
python