Python Pandas using lambda on index row by row
<p>So I'm trying to apply a function to the index row by row but having some problems</p>

<pre><code>startDate = '2015-05-01 00:00'
endDate = '2015-05-08 00:00'
idx = pd.date_range(startDate, endDate, freq="1min")
df = pd.DataFrame(columns=['F(t)'])
df = df.reindex(idx, fill_value=0)

def circadian_function(T):
    return math.cos(math.pi*(T-delta)/12)
</code></pre>

<p>Everything is okay up to here but trying to apply the function I'm not sure what to do</p>

<pre><code>df['F(t)'] = df.index.apply(lambda x: circadian_function x[index].hour, axis=1)
</code></pre>

<p>Should I be using a lambda? Or just an apply?</p>