From 70fb848e2a1fb25583389a1b362e900f4beef9e9 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 29 Oct 2021 20:15:45 +0200 Subject: [PATCH] Import matplotlib in a good place --- algods/algods.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/algods/algods.py b/algods/algods.py index fa48458..ac17ebc 100644 --- a/algods/algods.py +++ b/algods/algods.py @@ -3,7 +3,6 @@ import unicodedata import sys from typing import Optional -from matplotlib import pyplot as plt import numpy as np SHINGLE_SIZE = 5 # Known as k @@ -331,6 +330,8 @@ def graph(stream, display_tqdm: bool = False) -> None: """ Draw statistic graphs about false-positive and true positive rates using matplotlib. """ + from matplotlib import pyplot as plt + docs = [line.rstrip('\n') for line in stream] # Read stream docs = [normalize(doc) for doc in docs] # Remove special characters and normalize accents