Search
 
SCRIPT & CODE EXAMPLE
 

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)

Comment

PREVIOUS NEXT
Code Example
Python :: labelling row in python 
Python :: loosen_pickle 
Python :: expand array to a certain size python 
Python :: Filter xarray (dataarray) 
Python :: np array specified lengte same value 
Python :: pie chart labeling 
Python :: list example in python 
Python :: how to print using .sh file from python 
Python :: separate alphanumeric list 
Python :: ipython run script with command line arguments 
Python :: add constant to all values of columns in dataframe python 
Python :: with statement python 3 files 
Python :: add label on choropleth map python 
Python :: is console and terminal is same in spyder python(3.9) 
Python :: python how to find index of an element in a 2d list 
Python :: python project pick text color according to background 
Python :: add a third dimension matrix dataset python 
Python :: get number of occurrences of substring case independent python 
Python :: appending hdf5 files 
Python :: def square_odd(pylist) 
Python :: python difference between multiprocessing pool and threadpool 
Python :: remove brackets from string python 
Python :: passport ocr python 
Python :: download textdocuments with python 
Python :: matplotlib FiveThirtyEight horizontal graph 
Python :: operations in python 
Python :: df.loc jupyter 
Python :: mechanize python XE #29 
Python :: How do I select certain columns for regression plots 
Python :: Solve abstract model relations conflicts while using inheritance 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =