質問編集履歴

1

追記を追加

2021/04/12 20:25

投稿

man_
man_

スコア45

test CHANGED
File without changes
test CHANGED
@@ -99,3 +99,45 @@
99
99
  OS:ubuntu18.04
100
100
 
101
101
  言語:python2.7
102
+
103
+
104
+
105
+ #追記
106
+
107
+ ###プログラム変更点
108
+
109
+ ```python
110
+
111
+
112
+
113
+ df.style.applymap(cell_style)
114
+
115
+
116
+
117
+ colors = [["#56b5fd","w","w"],[ "#1ac3f5","w","w"],[ "#1ac3f5","w","w"]]
118
+
119
+ fig,ax = plt.subplots(figsize=((len(df.columns))*1.2, (len(df))*0.5))
120
+
121
+ ax.axis('off')
122
+
123
+ tbl = ax.table(cellText=df.values,
124
+
125
+ bbox=[0,0,1,1],
126
+
127
+ colLabels=df.columns,
128
+
129
+ rowLabels=df.index,
130
+
131
+ cellColours=colors)
132
+
133
+ plt.savefig('table.png')
134
+
135
+ ```
136
+
137
+ ###エラー
138
+
139
+ ```ここに言語を入力
140
+
141
+ ValueError:Each row in 'cellColours' must have 6 columns
142
+
143
+ ```