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

Add example data #376

Merged
merged 2 commits into from
Sep 29, 2023
Merged

Add example data #376

merged 2 commits into from
Sep 29, 2023

Conversation

jpwgnr
Copy link

@jpwgnr jpwgnr commented Sep 29, 2023

Fix issue #365

@jpwgnr jpwgnr requested a review from chrbeckm September 29, 2023 06:07
@chrbeckm
Copy link
Member

chrbeckm commented Sep 29, 2023

I think it is better to save the generated data in a file. This way, the participants can use np.genfromtxt again. And the fit values are the same between implementation and solution.

rng = np.random.default_rng(seed=42)
x = rng.random(10)
y = 1.6 * x + 0.2 * rng.uniform(-1,1, len(x))
np.savetxt("daten.txt", np.column_stack([x, y]), header="x y")

@jpwgnr
Copy link
Author

jpwgnr commented Sep 29, 2023

@chrbeckm What do you mean by "same between implementation and and solution"?
I fixed the solution correspondingly.

@chrbeckm
Copy link
Member

I overlooked the seed, so I am wrong, the values will be the same.

@jpwgnr
Copy link
Author

jpwgnr commented Sep 29, 2023

You like it better, this way?

@jpwgnr jpwgnr merged commit 75cf586 into main Sep 29, 2023
1 check passed
@jpwgnr jpwgnr deleted the scipy_linregress_add_example_data branch September 29, 2023 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants