the 4 cells pleass
6. Tables Question 1. Suppose you have 4 apples, 3 oranges, and 3 pineapples. (Perhaps you're using Python to solve a high school Algebra problem. ) Create a table that contains this information. It should have two columns Fruit nane and count Assign the new table to the variable fruits Note: Use lower-case and singular words for the name of each fruit, he apple In CMOur solution uses 1 statement split over 3 lines. Fruits fruits Question 2. The file Inventory.csv contains information about the inventory at a fruit stand. Each row represents the contents of one box of fruit. Load it as a table named Inventory using the Table read_table() function Table read_table...) takes one argument (data file name in string format) and returns a table In inventory ... Inventory Question 3. Does each box at the fruit stand contain a different fruit? Set 11_01ferent to True Weach box contains a different fruit or to raise multiple boxes contain the same fruit Hint You don't have to wie code to calculate the True False value for all different Just look at the inventory table and assign all different to emer True or False according to what you can see from the table in answering the question In Mall different ... 11 different Question 4. The file sales.csv contains the number of fruit sold from each box last Saturday It has an extra column called "price per fruit ($)" that's the price per item of fruit for fruit in that box The rows are in the same order as the inventory table. Load these data into a table called sales sales - sales Fle Edi View Insert Cell Keme Holbo Python 3 O Run C Code 3. Basic Array Arithmetic Question 1. Multiply the numbers 42.4224.42422424, and -250 by 157. Assign each variable below such that first product is assigned to the result of 42. 157, second products assigned to the result of 4224. 157 and so on. For this question, don't use array In t 1 N first product ... second product third product fourth product print(first product, second product, third product, fourth product) Question 2. Now do the same calculation, but using an array called numbers and only a singlo multiplication (*) cporntor. Store the results in an array named products In 1: Mnunbers products products Question 3. Oops, we made a typolitoad of 157, we wanted to multply each number by 1577 Computo the correct products in the coll below using array writhmetic. Notice that your job la renty easy if you previously defined an array containing the 4 number In 1 Ncorrect products correct products Question 4. We've loaded an array of temperatures in the next cell. Each number is the highest temperature observed on a day at a climate observation station, mostly from the US Since they're from the US goverment agency NOAA, of the temperatures are in Fahrenheit Convert them all to Celsius by first subtracting 32 from them, then multiplying the results by Make sure to ROUND the front rosult after converting to Colous to the nearest Integer using the np. round function In tl max temperatures - Table read table(romperatures.csv').column (Bally Mae Tenperature) celsius_max_temperatures - celsius_max_temperatures Question. The cell below loads an array cated president birth_years Calling .colun..) on a table returns an array of the column specified in this case the sirth Year column of the president birthe table. The last element in that array in the most recent bith your of any decensed president. Ansign that year to most recent birth year In [10]: W president birth_yearsTable read_table('president_birth.csv").column('Birth Year) most recent_birth year. most recent birth year Dut (10) lipsis Question 5. Finally, assign sof_birth_years to the sum of the first, tenth, and last birth year in president_birth years In 1: Hum_of_birth years .10 Es is + -15 Question 3. You'll sometimes want to find the last element of an array Suppose an array has 142 elements. What is the index of its last element? In 17): Mindex_of_last_lenent. 141 More often, you don't know the number of clements in an array, its length (For example, it might be a large dataset you found on the Internet.) The function len takes a single argument, an array, and returns the length of that array(anteger) Question 4. The cell below loads an array called president birth_years Cating colunur.) on a table returns an array of the column specified in this case the Birth Year column of the president birthe table. The conclement in that array is the most recent birth year of any deceased prouident Assign that year to most recent_birth year In (): president birth_years Table.read table("president_births).columneirth Year") most recent_birth_year president_birth_years(-1) most recent_birth year Out[011917 Questions. Finally, assign sum_of_birth_years to the sum of the true toth, and last beth you in president birer years Mun_of_birthyears. Int (president_with_year=[0]). Impresident birthyearst. Int (president_birth yeart-1]) In (1 3. Basic Array Arithmetic Question 1. Multiply the numbers 42. 4224,42422424 and 250 by 157 Assign each variable below such that first product is assigned to the result of 42. 157. second producerar in the 14-157 Edit View Insert Cell Kernel Help Run Code 4 apples 3 oranges 3 pineapples Question 2. The file inventory.csv contains information about the inventory at a fruit a table named inventory using the Table.read_table() function. Table.read_tal returns a table. In [66]: N inventory Table.read_table("inventory.csv) inventory Out[66]: box ID fruit name count 53686 kiwi 45 57181 strawberry 123 25274 apple 20 48800 orange 35 26187 strawberry 255 57930 grape 517 52357 strawberry 102 43566 peach 40 Question 3. Does each box at the fruit stand contain a different fruit? Set all differen multiple boxes contain the same fruit. Hint: You don't have to write code to calculate the True/False value for all different either True or False according to what you can see from the table in answering the qu In ( ): all_different = all_different Question 4. The file sales.csv contains the number of fruit sold from each box last Sat price per item of fruit for fruit in that box. The rows are in the same order as the inventor To 1 ch 6. Tables Question 1. Suppose you have 4 apples, 3 oranges, and 3 pineapples. (Perhaps you're using Python to solve a high school Algebra problem. ) Create a table that contains this information. It should have two columns Fruit nane and count Assign the new table to the variable fruits Note: Use lower-case and singular words for the name of each fruit, he apple In CMOur solution uses 1 statement split over 3 lines. Fruits fruits Question 2. The file Inventory.csv contains information about the inventory at a fruit stand. Each row represents the contents of one box of fruit. Load it as a table named Inventory using the Table read_table() function Table read_table...) takes one argument (data file name in string format) and returns a table In inventory ... Inventory Question 3. Does each box at the fruit stand contain a different fruit? Set 11_01ferent to True Weach box contains a different fruit or to raise multiple boxes contain the same fruit Hint You don't have to wie code to calculate the True False value for all different Just look at the inventory table and assign all different to emer True or False according to what you can see from the table in answering the question In Mall different ... 11 different Question 4. The file sales.csv contains the number of fruit sold from each box last Saturday It has an extra column called "price per fruit ($)" that's the price per item of fruit for fruit in that box The rows are in the same order as the inventory table. Load these data into a table called sales sales - sales Fle Edi View Insert Cell Keme Holbo Python 3 O Run C Code 3. Basic Array Arithmetic Question 1. Multiply the numbers 42.4224.42422424, and -250 by 157. Assign each variable below such that first product is assigned to the result of 42. 157, second products assigned to the result of 4224. 157 and so on. For this question, don't use array In t 1 N first product ... second product third product fourth product print(first product, second product, third product, fourth product) Question 2. Now do the same calculation, but using an array called numbers and only a singlo multiplication (*) cporntor. Store the results in an array named products In 1: Mnunbers products products Question 3. Oops, we made a typolitoad of 157, we wanted to multply each number by 1577 Computo the correct products in the coll below using array writhmetic. Notice that your job la renty easy if you previously defined an array containing the 4 number In 1 Ncorrect products correct products Question 4. We've loaded an array of temperatures in the next cell. Each number is the highest temperature observed on a day at a climate observation station, mostly from the US Since they're from the US goverment agency NOAA, of the temperatures are in Fahrenheit Convert them all to Celsius by first subtracting 32 from them, then multiplying the results by Make sure to ROUND the front rosult after converting to Colous to the nearest Integer using the np. round function In tl max temperatures - Table read table(romperatures.csv').column (Bally Mae Tenperature) celsius_max_temperatures - celsius_max_temperatures Question. The cell below loads an array cated president birth_years Calling .colun..) on a table returns an array of the column specified in this case the sirth Year column of the president birthe table. The last element in that array in the most recent bith your of any decensed president. Ansign that year to most recent birth year In [10]: W president birth_yearsTable read_table('president_birth.csv").column('Birth Year) most recent_birth year. most recent birth year Dut (10) lipsis Question 5. Finally, assign sof_birth_years to the sum of the first, tenth, and last birth year in president_birth years In 1: Hum_of_birth years .10 Es is + -15 Question 3. You'll sometimes want to find the last element of an array Suppose an array has 142 elements. What is the index of its last element? In 17): Mindex_of_last_lenent. 141 More often, you don't know the number of clements in an array, its length (For example, it might be a large dataset you found on the Internet.) The function len takes a single argument, an array, and returns the length of that array(anteger) Question 4. The cell below loads an array called president birth_years Cating colunur.) on a table returns an array of the column specified in this case the Birth Year column of the president birthe table. The conclement in that array is the most recent birth year of any deceased prouident Assign that year to most recent_birth year In (): president birth_years Table.read table("president_births).columneirth Year") most recent_birth_year president_birth_years(-1) most recent_birth year Out[011917 Questions. Finally, assign sum_of_birth_years to the sum of the true toth, and last beth you in president birer years Mun_of_birthyears. Int (president_with_year=[0]). Impresident birthyearst. Int (president_birth yeart-1]) In (1 3. Basic Array Arithmetic Question 1. Multiply the numbers 42. 4224,42422424 and 250 by 157 Assign each variable below such that first product is assigned to the result of 42. 157. second producerar in the 14-157 Edit View Insert Cell Kernel Help Run Code 4 apples 3 oranges 3 pineapples Question 2. The file inventory.csv contains information about the inventory at a fruit a table named inventory using the Table.read_table() function. Table.read_tal returns a table. In [66]: N inventory Table.read_table("inventory.csv) inventory Out[66]: box ID fruit name count 53686 kiwi 45 57181 strawberry 123 25274 apple 20 48800 orange 35 26187 strawberry 255 57930 grape 517 52357 strawberry 102 43566 peach 40 Question 3. Does each box at the fruit stand contain a different fruit? Set all differen multiple boxes contain the same fruit. Hint: You don't have to write code to calculate the True/False value for all different either True or False according to what you can see from the table in answering the qu In ( ): all_different = all_different Question 4. The file sales.csv contains the number of fruit sold from each box last Sat price per item of fruit for fruit in that box. The rows are in the same order as the inventor To 1 ch