Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

AssertionError: col should be Column

Highlighted

AssertionError: col should be Column

New Contributor

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?

Don't have an account?
Coming from Hortonworks? Activate your account here