使用pysolar和Pandas计算太阳方位角[Python]

Calculating solar azimuth by using pysolar and Pandas [Python]

I am trying to calculate solar azimuth angle by using Pysolar and Pandas. I want to calculate the azimuth angle of the index of the DataFrame (as shown in the code below). But while using i<2, the results are the same azimuth angle for all dates and times and then for the second time (i==1) it is different but same for all dates and times. I just want to calculate azimuth for each date and time as a separate column. Any idea on what I am doing wrong?

>> import pandas as pd
>> import numpy as np
>> from pysolar.solar import *
>> importdatetime
>> X=pd.read_csv('/home/optim7/Dropbox/Smart_Analytics_work/WeatherData_WOOPA/PV_data/Testing123.csv',index_col='Datetime')
>> X.index = pd.to_datetime(X.index,unit='s')
>> X.head()
                    A
Datetime    
2014-08-01 00:00:00 0
2014-08-01 00:15:00 0
2014-08-01 00:30:00 0
2014-08-01 00:45:00 0
2014-08-01 01:00:00 0
>> i = 0
>> while i < 2:
>> X['Azimuth']= get_azimuth(42.206,-71.382,X.index[i])
>> print (X)
>> i+=1

The output is

                      A Azimuth
Datetime                           
2014-08-01 00:00:00   0 -107.280839
2014-08-01 00:15:00   0 -107.280839
2014-08-01 00:30:00   0 -107.280839
...
[42570 rows x 2 columns]
                      A Azimuth
Datetime                           
2014-08-01 00:00:00   0 -107.280839
2014-08-01 00:15:00   0 -107.280839
2014-08-01 00:30:00   0 -107.280839
...
[42570 rows x 2 columns]