I'm new to Pyspark 3.0 and I have this homework where I need to change the string (geolocation) to tuple numeric data type (geolocation1).
Here is my code:
from pyspark.sql.functions import *
from pyspark.sql.types import *
df = df2.withColumn('geolocation1', col('geolocation').cast('double'))
Output:
| geolocation | geolocation1 |
| ------------------------------------------| ----------------- |
| (-37.80899950, 140.96004459) | null |
| (-37.80899952, 140.96004451) | null |
What have I done wrong here?
