title: Converting lat, long to x, y in state plane with pyproj
body: <p>I am having trouble transforming a dataframe I have of latitude and longitude coordinates to the state plane projection. I've attempted to use code I found in another post but it keeps throwing "AttributeError: 'float' object has no attribute 'set_value'". Here is a link to the original code so I can properly credit it: <a href="https://stackoverflow.com/a/36871668/8754430">https://stackoverflow.com/a/36871668/8754430</a></p>
  
  <p>Here is my code</p>
  
  <pre><code>    import pyproj
      import numpy as np
  
      subways_loc = pd.read_csv('subways_loc.csv')
  
      NAD83_LI = pyproj.Proj(init = "EPSG:32118")
      NYS_LIZ = pyproj.Proj(init = "ESRI:102718")
  
      def coord_transform(df):
          x = pd.Series()
          y = pd.Series()
          for idx, val in enumerate(df['Latitude']):
              x, y = pyproj.transform(NAD83_LI, NYS_LIZ, df['Longitude'][idx], df['Latitude'][idx])
              x.set_value(idx, x)
              y.set_value(idx, y)
          df['x'] = x
          df['y'] = y
          return df
  
      subways_loc_trans = coord_transform(subways_loc)
  
      print(subways_loc_trans.head(1))
  </code></pre>
  
  <h2>And here is the specific error:</h2>
  
  <pre><code>    AttributeError                            Traceback (most recent call last)
      &lt;ipython-input-103-a13e9199a9d5&gt; in &lt;module&gt;()
           11     print(x, y)
           12 
      ---&gt; 13 subways_loc_trans = coord_transform(subways_loc)
           14 
           15 print(subways_loc_trans.head(1))
  
      &lt;ipython-input-103-a13e9199a9d5&gt; in coord_transform(df)
            4     for idx, val in enumerate(df['Latitude']):
            5         x, y = pyproj.transform(NAD83_LI, NYS_LIZ, df['Longitude'][idx], df['Latitude'][idx])
      ----&gt; 6         x.set_value(idx, x)
            7         y.set_value(idx, y)
            8     df['x'] = x
  
      AttributeError: 'float' object has no attribute 'set_value'
  </code></pre>
  
  <p>Here is the link to my github upload of the file <a href="https://github.com/amkaris/SB-Code/blob/master/subways_loc.csv" rel="nofollow noreferrer">https://github.com/amkaris/SB-Code/blob/master/subways_loc.csv</a>.</p>
  
  <p>Any and all help is appreciated! Thanks!</p>