Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
arr2
to_json
from_json
You can use the drop function only. The way to select the nested columns is with .
drop
.
Like window.start and window.end. You can access your arr2 as arr1.element.arr2.
window.start
window.end
arr1.element.arr2
df.drop(df.element.arr2)
Add a comment
Required, but never shown
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.
Explore related questions
See similar questions with these tags.
to_json+from_json, see one similar post: stackoverflow.com/questions/58243292