How to answer task 3 using only numpy, matplotlib.pyplot, csv, ndarray from numpy. Here's what ive got: Create an array
Posted: Thu May 05, 2022 1:01 pm
How to answer task 3 using only numpy, matplotlib.pyplot,
csv, ndarray from numpy.
Here's what ive got:
Create an array full of zeros in which you will store the
averaged numbers. The task sheet implies what the size of this
array should be;
Depending on the size of the averaging window, some of the rows
at the start and end will not have the averaging applied to them.
Use the window size to calculate what this offset should be;
Loop over the rows that you DO want to apply the average to;
Use the window/offset to slice out the numbers to be averaged
and calculate the average;
Use the index information from your loop to store the averaged
data in your new array.
csv, ndarray from numpy.
Here's what ive got:
Create an array full of zeros in which you will store the
averaged numbers. The task sheet implies what the size of this
array should be;
Depending on the size of the averaging window, some of the rows
at the start and end will not have the averaging applied to them.
Use the window size to calculate what this offset should be;
Loop over the rows that you DO want to apply the average to;
Use the window/offset to slice out the numbers to be averaged
and calculate the average;
Use the index information from your loop to store the averaged
data in your new array.