擅长:python、mysql、java
<p>也可以将<code>reindex</code>与索引<code>append</code>一起使用</p>
<pre><code>df.reindex(pd.Index(['2014-05-21 09:30:00']).append(df.index),fill_value=2)
Out[116]:
value
2014-05-21 09:30:00 2.0
2014-05-21 10:00:00 13.0
2014-05-21 10:30:00 8.0
2014-05-21 11:00:00 9.0
2014-05-21 11:30:00 7.0
2014-05-21 12:00:00 2.0
</code></pre>