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

Episode 6 - "General Composite Statistics" exercise #975

Open
faizbond opened this issue Jan 16, 2022 · 2 comments
Open

Episode 6 - "General Composite Statistics" exercise #975

faizbond opened this issue Jan 16, 2022 · 2 comments

Comments

@faizbond
Copy link
Contributor

In Episode 6, the exercise for General Composite Statistics seems to be missing some code on line 5 for the first part of the exercise. If that omission is by design and a part of the exercise, I believe some clarification should be made in the instructions leading up to the sample code.

If this is indeed an oversight, the code would then read as follows:

filenames = glob.glob('inflammation*.csv')
composite_data = numpy.zeros((60,40))

for filename in filenames:
    # sum each new file's data into composite_data as it's read
    data = numpy.loadtxt(fname = filename, delimiter=',')
    composite_data = composite_data + data

# and then divide the composite_data by number of samples
composite_data = composite_data / len(filenames) 

in place of

filenames = glob.glob('inflammation*.csv')
composite_data = numpy.zeros((60,40))
for filename in filenames:
    # sum each new file's data into composite_data as it's read
    #
# and then divide the composite_data by number of samples
composite_data = composite_data / len(filenames)
@ldko
Copy link
Contributor

ldko commented Jan 18, 2022

Hi @faizbond , I believe the omission is by design and intentional. Do you think it would be more clear if the first part of the instructions said: "Use each of the files once to generate a dataset containing values averaged over all patients by completing the code inside the loop given below:" ? If you think this works, or you would like to propose other text, you are welcome to open a pull request.

@faizbond
Copy link
Contributor Author

@ldko I think that would work!

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

No branches or pull requests

2 participants