Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide changes data array #4

Closed
rggs opened this issue Apr 27, 2020 · 4 comments
Closed

Divide changes data array #4

rggs opened this issue Apr 27, 2020 · 4 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@rggs
Copy link

rggs commented Apr 27, 2020

In line 86 of the stochastic file,
data[i]/=n
changes the shape of data. Changing it to
data[i]=data[i]/n
fixes this.

@p-j-r p-j-r self-assigned this Apr 28, 2020
@p-j-r p-j-r added the invalid This doesn't seem right label Apr 28, 2020
@p-j-r
Copy link
Owner

p-j-r commented Apr 28, 2020

There's a chance that the first run of this simulation fails!
Pylab tools returns a warning UserWarning: Creating legend with loc="best" can be slow with large amounts of data.
This is due to the huge amount of data present. So run it again...

@p-j-r
Copy link
Owner

p-j-r commented Apr 28, 2020

However both,
data[i]/=n and data[i]=data[i]/n produce exactly the same results. After all, /= is just the shorthand symbol for that.

@p-j-r
Copy link
Owner

p-j-r commented Apr 28, 2020

The shape of data still remains unchanged...

image

@p-j-r p-j-r closed this as completed Apr 28, 2020
@rggs
Copy link
Author

rggs commented Apr 29, 2020

Ah you're right! I knew /= had the same functionality, but for whatever reason when I changed that line it ran, after a couple failures. Sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants