How to get rows with the max value by using Python?
<p>I have R code to use data table to merger the rows with same FirstName and LastName but selecting the max value for specified columns(e.g. Score1, Score2, Score3). The input/output is as follows:</p>

<p><Strong>Input:</Strong></p>

<pre>
FirstName LastName Score1 Score2 Score3
fn1       ln1      41      88     50
fn1       ln1      72      66     77
fn1       ln1      69      72     90
fn2       ln2      80      81     73
fn2       ln2      59      91     66
fn3       ln3      75      80     66
</pre>

<p><Strong>Output:</Strong></p>

<pre>
FirstName LastName Score1 Score2 Score3
fn1       ln1      72      88     90
fn2       ln2      80      91     73
fn3       ln3      75      80     66
</pre>

<p>Now I want to migrate the R program to Spark. How can I do this by using Python?</p>

<pre><code>import pandas
rows = pandas.read_csv('rows.csv', delim_whitespace=True)
rows.groupby(['FirstName', 'LastName']).max()
</code></pre>

python apache-spark