2
我想用数据框的一部分来标注我的情节。但是,时间00:00:00出现在所有行标签中。由于我的数据每天都在频率中,是否有一种干净的方法可以将它们删除?我已经尝试了标准化功能,但这并没有消除时间;它只是零时间。一张图中熊猫表格式的索引
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pandas.tools.plotting import table
# Setup of mock data
date_range = pd.date_range('2014-01-01', '2015-01-01', freq='MS')
df = pd.DataFrame({'Values': np.random.rand(0, 10, len(date_range))}, index=date_range)
# The plotting of the table
fig7 = plt.figure()
ax10 = plt.subplot2grid((1, 1), (0, 0))
table(ax10, np.round(df.tail(5), 2), loc='center', colWidths=[0.1] * 2)
fig7.show()