TypeError: 'DataFrame' चीज का समर्थन नहीं करता है आइटम जब काम का उपयोग कर विभाजन.
विभाजित दो पूर्णांक स्तंभ में एक pyspark dataframe और इस प्राप्त करने में त्रुटि. किसी भी विचार है?
प्रतिलिपि प्रस्तुत करने योग्य:
simpleData = (((1, 2), (2, 6), (3, 6))
columns= ["sales","users"]
df = spark.createDataFrame(data = simpleData, schema = columns)
df = df.withColumn("users", df["users"].cast(IntegerType()))
df = df.withColumn("sales", df["sales"].cast(IntegerType()))
df['buy_rate'] = df['sales']/ df['users']