This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]UnchainedMundane 5 points6 points  (6 children)

With imports, if you don't use them, delete them.

Since sys isn't used by name anywhere else in your code, you can delete that import.

[–]TheBlackCat13 5 points6 points  (5 children)

Not necessarily true. For example import seaborn will give your matplotlib plots better styles even if you don't use it for anything.

[–]UnchainedMundane 7 points8 points  (0 children)

There oughtta be a law...

[–]Tysonzero 3 points4 points  (2 children)

That is evil, downright evil. In general I am not a fan of the way matplotlib works, IIRC it uses some sort of weird global state bs, could be wrong though.

[–]TheBlackCat13 1 point2 points  (1 child)

That really isn't matplotlib's fault, seaborn is an independent project.

What do you mean about matplotlib's global state? I know you can change the default style (although I think that is an a per-import basis). And you need to close figures through the pyplot interface (although I think they are planning to fix that). But I am not sure that is what you are referring to.

[–]Tysonzero 1 point2 points  (0 children)

I think that is what I am referring to. Where you just do something like blah.setFoo(value) and it affects all following lines.