【发布时间】:2015-09-14 05:11:51
【问题描述】:
作为我之前question的扩展
使用相同的数据集,我无法完成注释。
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set()
df = pd.read_csv('heat_map_data.csv')
df3 = df.copy()
for c in ['Place','Name']:
df3[c] = df3[c].astype('category')
sns.heatmap(df3.pivot_table(index='Place', columns='Name', values='00:00:00', annot=True) )
plt.show()
错误:
Traceback (most recent call last):
File "heatmap_sns.py", line 13, in <module>
sns.heatmap(df3.pivot_table(index='Place', columns='Name', values='00:00:00', annot=True) )
TypeError: pivot_table() got an unexpected keyword argument 'annot'
请提出解决办法?
【问题讨论】:
标签: python matplotlib annotations seaborn