Python 3 PySpark Library Example to Read CSV Files Using Spark Library Full Tutorial

Python 3 PySpark Library Example to Read CSV Files Using Spark Library Full Tutorial

Python 3 PySpark Library Example to Read CSV Files Using Spark Library Full Tutorial

from pyspark.sql import SparkSession

spark = SparkSession 
    .builder 
    .appName("how to read csv file") 
    .getOrCreate()
    
df = spark.read.csv('data.csv',header=True)

df.show()
name,class
gautam,11
sumit,12
john,23
sameer,29
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment