Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def clean_bci_data(bci_years: List[str], start_year: int, bci_scores: list) -> None: ***Update bci_years so that each element contains the year as a string, starting from start_year and

image text in transcribed
image text in transcribed
def clean_bci_data(bci_years: List[str], start_year: int, bci_scores: list) -> None: ***Update bci_years so that each element contains the year as a string, starting from start_year and decreasing by one for each subsequent element, until boi_years has the same length as bci_scores. Also update bci_scores so that all non-empty string values are float values, and all empty string values are MISSING_BCI. Preconditions: lencbci_years) - 0 len(bci_scores) > 0 start_year - lenCbci_scores) > 0 every value in bci...scores is either an empty string or can be converted to a float >>> years = 0 >>> scores - ["', "72.3', ', '69.5', , '70.0', ', '70.3", "] >>> clean_bci_data(years, 2013, scores) >>> years [*2013', '2012', '2011', 2010', '2009', '2008', '2007, 2006', '2005') [-1.0, 72.3, -1.0, 69.5, -1.0, 70.0, -1.0, 70.3, -1.01 >>> Scores def trim_from_endraw_data: list, count: int) -> -> None: **** "Update raw_data so that count elements have been removed from the end. Preconditions: count > 0 lenCraw_data) >= count 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 - 390 391 392 393 394 >>> my_lst = [[72.3, 69.5, 70.0, 70.3, 70.5, 70.7, 72.9], ", '72.3',' '69.5', '', '70', ', '70.3', ', '70.5', '', '70.7', '72.9', ''] >>> trim_from_end(my_1st, 14) >>> my_lst [[72.3, 69.5, 70.0, 70.3, 70.5, 70.7, 72.9]] def clean_span_dataCraw_spans: str) -> List[float]: ****"Return a list of span lengths from raw_spans, in the same order that they appear in raw_spans. Precondition: 1 raw_spans is in the appropriate format (see handout for details) >>> clean_span_data('Total-64 (1) 12;(2)-19;(3)-21;(4)-12;') [12.0, 19.0, 21.0, 1.2.0)

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 Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions