So what is this?
Improved the script
Bug fixed. In line 18 a function was returned instead of the array itself.
Bug fixed. new_values.append works in-place, therefore values was changed with it, having the same identity. A deepcopy of values prevents this from happening.
Bug fixed. The integral was taken along the y-axis instead of the x-axis. Just had to change x and y in trapz(x, y) to trapz(y, x).
Bug fixed in example_4.py. Interval from which the median was taken was too big. Changed it to a width of 1.2 instead of 5. Own comments in other files were deleted.
New diagram for the new width. It now follows the blue points much closer.
Own comments were deleted.
Merge branch 'master' of https://github.com/Sventon3003/problem_set_7
Bug fixed. In line 18 the function x.sort() was returned instead of an array. Now changed it to sorting first and then returning the array.
Bug fixed. function list.append() works in-place, therefore the original list values was changed as well. Using a deepcopy of values fixed the problem.
Bug fixed. The original integration integrated over the y-axis instead of the x-axis. Changed y and x from trapz(x, y) to trapz(y, x).
Bug fixed. The width of the intervall for the median was too big. Changed it to 1.2 instead of 5.
Plot revised. Now follows blue points much closer than before.