ctgk / PRML

PRML algorithms implemented in Python
MIT License
11.43k stars 3.25k forks source link

Weird "f" letters randomly added in code #12

Closed catubc closed 5 years ago

catubc commented 5 years ago

Hi. Thanks so much for writing this code, very useful for learning and teaching.

One weird issue is there are these places where the letter 'f' was prefixed to some strings. Python2 crashes so I deleted them all.

Do you know what those are?

Thanks.

Here's an example from this file: /PRML/prml/rv/multivariate_gaussian_mixture.py

raise ValueError(f"sum of coef must be equal to 1 {coef}")

tommyod commented 5 years ago

They are Python 3 f-Strings.

catubc commented 5 years ago

Thanks. I couldn't get python3 to work with your code, so I had dropped into python2... but otherwise code works great.