I am trying to import legacy_round from textstat as follows:
from textstat.textstat import textstatistics,legacy_round
But I get following error:
ImportError: cannot import name 'legacy_round' from 'textstat.textstat'
Any idea how can fix this?
I am trying to import legacy_round from textstat as follows:
from textstat.textstat import textstatistics,legacy_round
But I get following error:
ImportError: cannot import name 'legacy_round' from 'textstat.textstat'
Any idea how can fix this?
Timeless
On
According to @alxwrd in (#186), you need to use _legacy_round instead of legacy_round.
from textstat.textstat import textstatistics
#add these two lines
from textstat import textstat
legacy_round = textstat._legacy_round
legacy_round was removed from recent version and it is possible you are using an older version.
You could try downgrading the textstat package to a version that includes it:
Or you can use the round function from the Python standard library instead of legacy_round: