擅长:python、mysql、java
<p>当索引不是DatetimeIndex时,您正在按DatetimeIndex编制索引:</p>
<pre><code> Order_DateC RegionC SalesC
18156 2010-01-04 Foreign 450.0
18155 2010-01-04 Domestic 1990.4
18154 2010-01-04 Domestic 37477.0
18152 2010-01-04 Domestic 0.0
18153 2010-01-04 Domestic 783.0
</code></pre>
<p>因此出现了NaNs和NaTs。在</p>
<p>也许您想将<code>Order_DateC</code>作为索引:</p>
^{pr2}$
<p>然后到<a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.resample.html" rel="nofollow"><em>resample</em></a>。在</p>
<p>如果重新编制索引,将丢失具有重复日期的行。在</p>