title: Pandas Dataframe: how to take the real part of an entire dataframe?
body: <p>I have created the following dataframe where every element is a complex number:
  <a href="https://i.stack.imgur.com/p2ADB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p2ADB.png" alt="enter image description here" /></a></p>
  <p>now I try to create a new dataframe df_real where every cell is the real part of the corresponding position in df_test. I tried np.real(df_test) but it doesn't work:</p>
  <pre><code>np.real(df_test)
  
  Out[80]: 
  array([[(279000.5663863553-0.0003399120878497263j),
          (145911.9152796151-6.691409775191625e-05j),
          (74302.47221500448-1.3390870745126033e-05j)],
         [(297275.8777515915-0.00038331836673437703j),
          (155312.8041194384-7.517068053101233e-05j),
          (55978.12197869339-7.562623734480566e-06j)],
         [(291927.6794481343-0.00035796935780514757j),
          (153590.01541398693-7.126840201788457e-05j),
          (76296.08360291217-1.3520006287818232e-05j)]], dtype=object)
  </code></pre>
  <p>I also tried</p>
  <pre><code>df_test.apply(lambda x: np.real(x))
  </code></pre>
  <p>but it doesn't work neither:</p>
  <pre><code>100000.000000  ...                                179396.984925
  RAW_VAL_Element_Num                                               ...                                             
  ELEMENT 0             (279000.5663863553-0.0003399120878497263j)  ...  (74302.47221500448-1.3390870745126033e-05j)
  ELEMENT 2            (297275.8777515915-0.00038331836673437703j)  ...   (55978.12197869339-7.562623734480566e-06j)
  ELEMENT 3            (291927.6794481343-0.00035796935780514757j)  ...  (76296.08360291217-1.3520006287818232e-05j)
  
  [3 rows x 3 columns]
  </code></pre>
  <p>finally I tried</p>
  <pre><code>df_test.apply(lambda x: x.real)
  </code></pre>
  <p>but since x is a column it doesn't have real as attribut.</p>
  <p><strong>How can I take the real part of an entire dataframe?</strong></p>