r/Python • • Jun 09 '16

Scientific Python Cheat Sheet

https://ipgp.github.io/scientific_python_cheat_sheet/
476 Upvotes

62 comments sorted by

View all comments

2

u/qu4ku Jun 10 '16 edited Jun 10 '16

generators:

x = [for i in firstn(10)]

should be:

x = [i for i in firstn(10)]

2

u/Misterandrist Jun 10 '16 edited Jun 10 '16

Plus as written it demonstrates a list comprehension and not a generator (well... kind of) there's a difference between them that I think could be expressed more clearly

Edit: spelling

4

u/[deleted] Jun 10 '16

s/compression/comprehension

1

u/Misterandrist Jun 10 '16

Uf da. autocorrect strikes again.

2

u/tfhoon Jun 10 '16

thanks for pointing that. it's been edited and made clearer.