<p>您可以使用<a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.weekofyear.html" rel="nofollow noreferrer">^{<cd1>}</a>:</p>
<pre><code>rng = pd.date_range('2017-04-03', periods=6, freq='6M')
df = pd.DataFrame({'org':list('aaabbb'),
'estado':list('cccbbb'),
'destination':[4,5,4,5,5,4],
'time_total':[7,8,9,4,2,3],
'time_avg':[1,3,5,7,1,0],
'fecha':rng,
'tipo':list('aaabbb')})
df["fecha"] = df["fecha"].dt.weekofyear
print (df)
destination estado fecha org time_avg time_total tipo
0 4 c 17 a 1 7 a
1 5 c 44 a 3 8 a
2 4 c 18 a 5 9 a
3 5 b 44 b 7 4 b
4 5 b 18 b 1 2 b
5 4 b 44 b 0 3 b
</code></pre>
<hr/>
^{pr2}$
<hr/>
<pre><code>print (txt)
destination time_avg \
fecha 17 18 44 All 17 18 44 All
org tipo estado
a a c 1 1.0 1.0 3 1 5.0 3.000000 3.000000
b b b 1.0 2.0 3 1.0 3.500000 2.666667
All 1 2.0 3.0 6 1 3.0 3.333333 2.833333
time_total
fecha 17 18 44 All
org tipo estado
a a c 7 9.0 8.0 24
b b b 2.0 7.0 9
All 7 11.0 15.0 33
</code></pre>