Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to load csv file pyspark in anaconda

from pyspark.sql import SparkSession
spark = SparkSession 
    .builder 
    .appName("how to read csv file") 
    .getOrCreate()
spark.version

!ls data/sample_data.csv
df = spark.read.csv('data/sample_data.csv')
type(df)
df.show(5)

Source by www.nbshare.io #
 
PREVIOUS NEXT
Tagged: #load #csv #file #pyspark #anaconda
ADD COMMENT
Topic
Name
3+4 =