July 2018
Intermediate to advanced
474 pages
13h 37m
English
This section walks through the steps for the string conversion to a numeric value in the dataframe:
from pyspark.sql import functions
df = df.withColumn('gender',functions.when(df['gender']=='Female',0).otherwise(1))
df = df.select('height', 'weight', 'gender')
Read now
Unlock full access