text_plain_output_1.png
from pyspark.sql import SparkSession

from pyspark.sql.functions import format_number

from pyspark.sql import SparkSession
walmart_spark = SparkSession.builder.appName('Walmart_Stock_Price').getOrCreate()
walmart_spark

df_wmt = walmart_spark.read.csv('../input/wmtdata/WMT.csv', header=True, inferSchema=True)

df_wmt.columns

from pyspark.sql.functions import format_number

result = df_wmt.describe()
result.select(result['summary'],
              format_number(result['Open'].cast('float'),2).alias('Open'),
              format_number(result['High'].cast('float'),2).alias('High'),
              format_number(result['Low'].cast('float'),2).alias('Low'),
              format_number(result['Close'].cast('float'),2).alias('Close'),
              result['Volume'].cast('int').alias('Volume')
             ).show()

df_wmt.orderBy(df_wmt['High'].desc()).select('Date').show(1)