Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Solved
Go to solution
pyspark get row value from row object
Explorer
Created 05-29-2018 06:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using .collect method I am able to create a row object my_list[0] which is as shown below
my_list[0] Row(Specific Name/Path (to be updated)=u'Monitoring_Monitoring.csv')
How Can I fetch row value . It gives synatx errors as there are spaces in row name.
1 ACCEPTED SOLUTION
Super Guru
Created 05-29-2018 07:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do it in the 2 ways
my_list[0].__getitem__("col name")
my_list[0].asDict()["col name"]
Please "Accept" the answer if this works.
.
-Aditya
2 REPLIES 2
Super Guru
Created 05-29-2018 07:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do it in the 2 ways
my_list[0].__getitem__("col name")
my_list[0].asDict()["col name"]
Please "Accept" the answer if this works.
.
-Aditya
Expert Contributor
Created 05-29-2018 02:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OR
.collect()[0][1]
