title: Defining numpy.array in the __init__ function of a class
body: <p>I am not very familiar with writing <strong>classes</strong> in python, I am trying to modify one written class for my application. the problem is that I want to give <code>halo_pos</code> parameter as an input to the following <code>NFW</code> class: </p>
  
  <pre><code>class NFW(object):
      _req_params = { 'mass' : float , 'conc' : float , 'redshift' : float }
      _opt_params = { 'halo_pos' :[float,float]  , 'omega_m' : float , 'omega_lam' : float }
      _single_params = []
      _takes_rng = False
      _takes_logger = False
  
      def __init__(self, mass, conc, redshift, halo_pos, 
                   omega_m=None, omega_lam=None, cosmo=None):
          self.M = float(mass)
          self.c = float(conc)
          self.z = float(redshift)
          self.halo_pos.x = float(halo_pos[0])
          self.halo_pos.y = float(halo_pos[1])  
          self.cosmo = cosmo
  </code></pre>
  
  <p>if I pass the input for <code>halo_pos</code> for the following parameters</p>
  
  <pre><code>&gt;&gt;&gt; Xpos.value
  array(235.0)
  &gt;&gt;&gt; type(Xpos.value)
  &lt;type 'numpy.ndarray'&gt;
  &gt;&gt;&gt; Ypos.value
  array(340.0)
  omega_matter=0.23;omega_lambda=0.77
  </code></pre>
  
  <p>then when I try to call NFW class with the given inputs I get the following error message:</p>
  
  <pre><code>nfw = nfw_halo.NFWHalo(mass=M,conc=concentration,redshift=z_halo,halo_pos=[Xpos,Ypos],omega_m=omega_matter,omega_lam=omega_lambda)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "nfw_halo.py", line 156, in __init__
      self.halo_pos.x = float(halo_pos[0])
  AttributeError: 'NFWHalo' object has no attribute 'halo_pos'
  </code></pre>
  
  <p>How should I define <strong>halo_pos</strong> for my class in order to avoid raise error message?</p>