<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Rowwise manipulation of a DataFrame in PySpark. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Rowwise-manipulation-of-a-DataFrame-in-PySpark/m-p/226333#M188193</link>
    <description>&lt;P&gt;If have a DataFrame and want to do some manipulation of the Data in a Function depending on the values of the row.&lt;/P&gt;&lt;PRE&gt;my_udf(row):
	threshold = 10
	if row.val_x &amp;gt; threshold:
		row.val_x = another_function(row.val_x)
		row.val_y = another_function(row.val_y)
		return row
	else:
		return row&lt;BR /&gt;&lt;/PRE&gt;&lt;P style="margin-left: 20px;"&gt;&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to apply my udf to the DataFrame?&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2017 20:26:47 GMT</pubDate>
    <dc:creator>lukas_mueller02</dc:creator>
    <dc:date>2017-08-22T20:26:47Z</dc:date>
  </channel>
</rss>

