[英]Calculate and plot Heatmap in Python
我想將下面的矩陣除以60(將其轉換為秒),然后繪制heatmap
以查看密度。
Zone1 Zone2 Zone3 Zone4
2016-05-13_2 71 0 182 36
2016-05-14_3 94 0 0 68
2016-05-14_4 5 0 50 29
2016-05-17_5 0 101 0 36
2016-05-18_10 0 120 0 106
2016-05-18_11 62 0 784 3668
2016-05-18_12 0 330 0 19
我必須將其轉換為列表值,然后除以60
import pandas as pd
import plotly.plotly as py
df2=(df.values/60)
df3=list(df2)
py.iplot(df3, filename='basic-heatmap')
PlotlyError: The `figure_or_data` positional argument must be either `dict`-like or `list`-like.
請讓我知道哪里出了問題
您可以使用袖扣,這是一個通過Plotly輕松進行交互式熊貓圖表繪制的庫。 詳細信息請在這里查看https://plot.ly/ipython-notebooks/cufflinks/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.