From 2e2662eeac79cbb304df1f277a35d70011859334 Mon Sep 17 00:00:00 2001 From: spacewaterbear <38250076+spacewaterbear@users.noreply.github.com> Date: Fri, 30 Oct 2020 01:58:25 +0100 Subject: [PATCH] convert np.float to float for positions convert np.float to float (native python). It cannot be jsonify otherwise --- wordcloud/wordcloud.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wordcloud/wordcloud.py b/wordcloud/wordcloud.py index 26b0d5425..21ece36c0 100644 --- a/wordcloud/wordcloud.py +++ b/wordcloud/wordcloud.py @@ -521,6 +521,7 @@ def generate_from_frequencies(self, frequencies, max_font_size=None): # noqa: C break x, y = np.array(result) + self.margin // 2 + x, y = x.item(), y.item() #convert np.float to float (native python). It cannot be jsonify otherwise # actually draw the text draw.text((y, x), word, fill="white", font=transposed_font) positions.append((x, y))