title: Explain Function Mistake
body: <p>I managed to write my first function. however I do not understand it :-)
  I approached my real problem with a simplified on. See the following code:</p>
  
  <pre><code>import pandas as pd
  import matplotlib as plt
  import numpy as np
  from pyXSteam.XSteam import XSteam
  steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS) 
  T1_T_in = [398,397,395]
  T1_p_in = [29,29,29]
  T1_mPkt_in = [2.2,3,3.5]
  def Power(druck,temp,menge):
      H = []
      Q = []
      for i in range(len(druck)): 
          H.append(steamTable.h_pt(druck[i],temp[i]))
          Q.append(H[i]*menge[i])
      return Q
  
  t1Q=Power(T1_p_in,T1_T_in,T1_mPkt_in)
  t3Q = Power(T3_p_in,T3_T_in,T3_mPkt_in)
  print(t1Q)
  print(t3Q)
  </code></pre>
  
  <p>It works. The real problem now is different in that way that I read the data from an excel file. I got an error message and (according my learnings from this good homepage :-)) I added ".tolist()" in the function and it works. I do not understand why I need to change it to a list? Can anybody explain it to me? Thank you for your help.</p>
  
  <pre><code>import pandas as pd
  import matplotlib as plt
  import numpy as np
  from pyXSteam.XSteam import XSteam
  steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS) 
  
  pfad="XXX.xlsx"
  df = pd.read_excel(pfad)
  
  T1T_in = df.iloc[2:746,1]
  T1p_in = df.iloc[2:746,2]
  T1mPkt_in = df.iloc[2:746,3]
  
  def Power(druck,temp,menge):
      H = []
      Q = []
      for i in range(len(druck)): 
          H.append(steamTable.h_pt(druck.tolist()[i],temp.tolist()[i]))
          Q.append(H[i]*menge.tolist()[i])
      return Q
  
  t1Q=Power(T1p_in,T1T_in,T1mPkt_in)
  
  t1Q[0:10]
  </code></pre>