0

Consider I have the following data structure in a pyspark dataframe:

arr1:array
   element:struct
     string1:string
     arr2:array
         element:string
     string2: string

How can I remove the arr2 from my dataframe?

1

1 Answer 1

0

You can use the drop function only. The way to select the nested columns is with .

Like window.start and window.end. You can access your arr2 as arr1.element.arr2.

df.drop(df.element.arr2)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.