Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎10-16-2017

AssertionError: col should be Column

Hi,

I'm novice in pyspark.I'm using spark version 2.0.2 & python 2.7.I want to add index column in my data frame.So I used following code

z=np.array(np.arange(data.count()), dtype=np.int32)

data1 = data.withColumn('index', z)

 

But I'm getting error message as

AssertionError: col should be Column

 Can you please help me to solve the error?

Announcements