zhermes

Massachusetts

I'm a grad-student in Astrophysics, focusing on theory, and generally studying high-energy transients.

1d
comment efficiency vs. readability: obfuscation when using nested boolean index arrays
Interesting. I've never seen either of those tools before --- so I'm really excited to know about them now!
1d
comment efficiency vs. readability: obfuscation when using nested boolean index arrays
@seberg it looks like you were totally right. In the future including some type of explanatory information might be a little helpful...
1d
comment efficiency vs. readability: obfuscation when using nested boolean index arrays
Thanks! This is awesome. Using layman's approaches (%timeit and %memit) I can confirm that there is virtually no difference in time or memory usage.
1d
accepted efficiency vs. readability: obfuscation when using nested boolean index arrays
Oct
19
comment efficiency vs. readability: obfuscation when using nested boolean index arrays
@seberg I'm creating two new (large) arrays that aren't actually logically needed for functionality --- so that's extra memory, just like if I had suggested something like valid_data = data[valid_index]
Oct
19
asked efficiency vs. readability: obfuscation when using nested boolean index arrays
Oct
19
comment setup.py install leaving files where they are
It looks like -e doesn't mean the current directory --- it means whatever directory you point to; in this case .
Oct
18
accepted setup.py install leaving files where they are
Oct
18
comment setup.py install leaving files where they are
Thanks! Note: it needs to be pip install --user -e .
Oct
18
asked setup.py install leaving files where they are
Oct
18
comment emacs uses different indentation based on what's already in file
@AdamSmith ha, touche. Is there a reason for 4-spaces? I justed checked PEP8 and it doesn't say.
Oct
18
comment emacs uses different indentation based on what's already in file
@AdamSmith and anyway, it knows to correct 7 spaces to 8... so it seems to be recognizing all it needs to
Oct
18
comment emacs uses different indentation based on what's already in file
When I do M-x describe-mode, it tells me 'Python Mode' but doesn't say where it's defined...
Oct
18
comment emacs uses different indentation based on what's already in file
Thanks. I don't know which version, but I'm using Emacs 23.1.1 (Not my fault! Running on a remote cluster). Probably for this reason, your suggestion isn't working...
Oct
18
comment emacs uses different indentation based on what's already in file
@AdamSmith presumably with a combination of seeing that it starts a line, and correctly parsing the code semantics... And if PEP8 told you to jump off a bridge, would you?
Oct
18
asked emacs uses different indentation based on what's already in file
Oct
17
accepted use variables as key names when using numpy savez
Oct
17
asked use variables as key names when using numpy savez
Oct
11
awarded Autobiographer
Oct
9
comment print memory address of Python variable
This is the most accurate answer! Both to this post and to the "duplicate" (stackoverflow.com/questions/121396/…)
1 2 3 4 5