Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5: Code structure Write a function called analyze_data that takes a filename as its argument, and returns a dictionary with the following keys and

image text in transcribedimage text in transcribed

Problem 5: Code structure Write a function called analyze_data that takes a filename as its argument, and returns a dictionary with the following keys and the corresponding values: "c_initial': c_initial . 'c_max': c_max . 'c_final': c_final . 'rise_time': t_r 'peak_time': t_p 'perc_overshoot': percent_overshoot 'settling_time': T_s system_mass': m 'system_spring': k system_damping': C Replace your previous testing code in if __name__ == "__main__" so that the only output now is to print out all of the above parameters in alphabetical order from datal.csv, in the format key value, e.g. print(key, value). For instance, part of the output might look like: c_max 1.0 peak_time 2.05 perc_overshoot 25. 131951323 Write a function called backwards_filter which takes in a list and a positive integers and performs a backwards- looking mean filter with a customizable window size n. Unlike the mean filter from Lab 2, your filter should average points at the beginning even if the filter extends off the edge of the list. . For instance, if we have the list [0, 1, 2, 3, 4, 5] and n=3, the filter should turn the data into [0, 0.5, 1, 2, 3, 4]. . Modify analyze_data to accept a window_size argument which runs the position data through the above filter before computing the parameters. It should default to no filtering, i.e. a window size of 1. analyze_data('my_file.csv', window_size=5) ## 5-window filtering analyze_data('my_file.csv') ## No filtering Problem 5: Code structure Write a function called analyze_data that takes a filename as its argument, and returns a dictionary with the following keys and the corresponding values: "c_initial': c_initial . 'c_max': c_max . 'c_final': c_final . 'rise_time': t_r 'peak_time': t_p 'perc_overshoot': percent_overshoot 'settling_time': T_s system_mass': m 'system_spring': k system_damping': C Replace your previous testing code in if __name__ == "__main__" so that the only output now is to print out all of the above parameters in alphabetical order from datal.csv, in the format key value, e.g. print(key, value). For instance, part of the output might look like: c_max 1.0 peak_time 2.05 perc_overshoot 25. 131951323 Write a function called backwards_filter which takes in a list and a positive integers and performs a backwards- looking mean filter with a customizable window size n. Unlike the mean filter from Lab 2, your filter should average points at the beginning even if the filter extends off the edge of the list. . For instance, if we have the list [0, 1, 2, 3, 4, 5] and n=3, the filter should turn the data into [0, 0.5, 1, 2, 3, 4]. . Modify analyze_data to accept a window_size argument which runs the position data through the above filter before computing the parameters. It should default to no filtering, i.e. a window size of 1. analyze_data('my_file.csv', window_size=5) ## 5-window filtering analyze_data('my_file.csv') ## No filtering

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

Different types of Grading?

Answered: 1 week ago

Question

Explain the functions of financial management.

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago

Question

2. How will the team select a leader?

Answered: 1 week ago