Setting a cell equal to a value in pandas
<p>I feel like an idiot right now, why isn't this working</p>

<pre><code>results = pd.DataFrame(columns=['avg_daily_rets','cum_rets','STDEV','Sharpe'])
results.cum_rets = 4
results
</code></pre>

<p>returns </p>

<pre><code>avg_daily_rets  cum_rets    STDEV   Sharpe
</code></pre>

<p>with no values</p>

<p>whereas </p>

<pre><code>results = pd.DataFrame(columns=['avg_daily_rets','cum_rets','STDEV','Sharpe'])
results.cum_rets = np.arange(5)
results
</code></pre>

<p>returns</p>

<pre><code>avg_daily_rets  cum_rets    STDEV   Sharpe
0   NaN 0   NaN NaN
1   NaN 1   NaN NaN
2   NaN 2   NaN NaN
3   NaN 3   NaN NaN
4   NaN 4   NaN NaN
</code></pre>

<p>ultimately i'm doing this:</p>

<pre><code>results = DataFrame(columns = ['avg_daily_rets','cum_rets','STDEV','Sharpe'])
results['avg_daily_rets'] = data.Daily_rets.mean()
print data.Daily_rets.mean()
results.cum_rets = data.Daily_rets.sum()
print data.Daily_rets.sum()
results.STDEV = data.Daily_rets.std()
print data.Daily_rets.std()
results.Sharpe = results.avg_daily_rets / results.STDEV * np.sqrt(250)
print results.avg_daily_rets / results.STDEV * np.sqrt(250)

0.0257851999606
46.3102191292
0.052303548452
Series([], dtype: float64)
</code></pre>

<p>and getting the same as above: </p>

<pre><code>avg_daily_rets  cum_rets    STDEV   Sharpe
</code></pre>