visualization.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:Supply-demand-forecasting 作者: LevinJ 项目源码 文件源码
def show_weather_bydate(self):
        self.weathdf['gap'] = self.weathdf['time_slotid'].apply(self.find_gap_by_timeslot)
        by_date = self.weathdf.groupby('time_date')
        size = len(by_date)
        col_len = row_len = math.ceil(math.sqrt(size))
        count = 1
        for name, group in by_date:
            ax=plt.subplot(row_len, col_len, count)
#             temp = np.empty(group['time_id'].shape[0])
#             temp.fill(2)

#             ax.plot(group['time_id'], group['gap']/group['gap'].max(), 'r', alpha=0.75)
#             ax.plot(group['time_id'], group['weather']/group['weather'].max())
            ax.bar(group['time_id'], group['weather'], width=1)
            ax.set_title(name)
            count = count + 1
#             plt.bar(group['time_id'], np.full(group['time_id'].shape[0], 5), width=1)

        plt.show()
        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号