Question: Still getting an assertion error: first part ( my code section ) assertion error: - - - - - - - - - - -

Still getting an assertion error:
first part (my code section) assertion error:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
in
35 # TODO: Redefine the three lists using the select_all_items function
36 # your code here
--->37 upto_1_year = select_all_items_in_freq_range(0,1/52)
38 one_year_to_1_quarter = select_all_items_in_freq_range(1/52,1/13)
39 less_than_1_quarter = select_all_items_in_freq_range(1/13, float('inf'))
in select_all_items_in_freq_range(lo, hi)
26 new_fft_data.append(0.0)
27 filtered_data = ifft(new_fft_data)
--->28 assert all( abs(imag(x))=1E-10 for x in filtered_data)
29 return [real(x) for x in filtered_data]
30
AssertionError:
Second part (plotting test) assertion error---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
in
26
27 N = len(weekly_prices)
--->28 assert(len(fft_frequencies)== len(weekly_prices))
29 assert(fft_frequencies[0]==0.0)
30 assert(abs(fft_frequencies[N//2]-0.5)=0.05), f'fft frequncies incorrect: {fft_frequencies[N//2]} does not equal 0.5'
AssertionError:
Still getting an assertion error: first part ( my

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!