title: Pandas: Calling value from another groupby table
body: <p>I would like to know more why .withcolumn cannot call data from another dataframe which has the same shape for the example below.</p>
  <p>I want to get a ratio from the dataset which is <code>max()/min()</code>.</p>
  <pre><code>temp_table1 = df[df['column A'] == value1)].groupby('ID').max()
  temp_table2 = df[df['column A'] == value1)].groupby('ID').min()
  result_table = temp_table1.withColumn(&quot;Ratio&quot;, temp_table1['max(column B)']/
                                       temp_table2['min(column B)'])
  </code></pre>
  <p>I got this error,</p>
  <blockquote>
  <p>AnalysisException: Resolved attribute(s)</p>
  </blockquote>