Using the following 2D array:
34 38 50 44 39 42 36 40 43 44 24 31 46 40 45 43 47 35 31 26 37 28 20 36 50
Sort the rows of the array based on first element of the row (i.e. rearrange the rows so that the first column's value determines the sort of the grid's rows). (this is for python coding)
'''
Python version : 2.7
Python program to sort the rows of the array based on first element of the row
(i.e. rearrange the rows so that the first column's value determines the sort of the grid's rows)
'''
# create the array
array = [[34,38,50,44,39],[42,36,40,43,44],[24,31,46,40,45],[43,47,35,31,26],[37,28,20,36,50]]
#print the original array
print('Original array : ')
for data in array:
print(data)
# sort the rows of the array based on first element of the row
for i in range(len(array)):
min = i
for j in range(i+1,len(array)):
if (array[j][0] < array[min][0]):
min = j
if i != min:
array[i],array[min] = array[min], array[i]
#print the sorted array
print('Sorted array : ')
for data in array:
print(data)
#end of program
Code Screenshot:
Output:
34 49 34 36 44 54 44 50 46 43 34 43 31 45 39 34 47 44 25 38 54 53 47 37 40 How many classes would you recommend? What class interval would you suggest? (Round up your answer to the next whole number.) Two thousand frequent business travelers are asked which midwestern city they prefer: Indianapolis, Saint Louis, Chicago, or Milwaukee. One hundred and eight liked Indianapolis best, 432 liked Saint Louis, 1258 liked Chicago, and the...
34 35 36 37 38 39 40 41 42 42 43 44 Question 42 of 44 (1 point) Attempt 1 of 1 | 3h 33m Remaining 112 Section Exercise 13 - 16 (cal Compute the least-squares regression equation for the given data set. Use a TI-84 calculator. Round the slope and y-intercept to at least four decimal places. ole 9 5 7 13 -8 - 2 6-10 4 3 32 37 1 5 -1 -13 FTP X ע Send data...
These are my instructions: Your data should have been read in from the data file and stored into an array. Next you need to calculate the following and display in a single Message box: Average score Highest score Lowest score Mode of the scores Your program should be written using methods and should be well documented internally and externally. Your output should be displayed using Message boxes. This is the .text file to use with the instructions: 20 21 22...
twenty eight 34 34 34 35 36 37 38 38 42 44 44 45 46 47 47 48 48 51 53 54 54 57 58 58 59 59 61 62 62 63 63 64 64 64 66 What is the percentile of thirtyeight
Solve Chapter 12 - Microsoft PowerPoint adye 34 35 36 ? 37 ? 38 E 39 40 UNBALANCED THREE-PHASE SYSTEMS The unbalanced A-load of Fig. is supplied by balanced voltages of 200 V in the positive sequence. Find the line currents. Take Vab as reference. 102 8? 42 Answer: 18.05/-41.06, 29.15/220.2, 31.87 74.270 A. 16 ? 43 45 46 47 48 491 50 51 Ela 75 % + ? 41
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 QUESTIONY An increase in the price of oil shifts the short-run Phillips curve right and the unemployment rate rises. short-run Phillips curve right and the unemployment rate falls. short-run Phillips curve left and the unemployment rate falls. short-run Phillips curve left and the unemployment rate rises. QUESTION 10 In the short run, an increase in government purchases increases real GDP...
1. Descriptive Statistics Data 20 25 40 41 42 43 44 45 46 47 48 49 50 50 51 52 53 54 55 56 57 58 59 60 65 80 90 For the data above calculate and draw the following: a. A Frequency Diagram with 7 classes. b. A Histogram C. A Stem and Leaf Diagram. Don't forget the instruction. d. The Five Number Summary e. The Box and Whisker Plot which needs the IQR, the Lower Fence and Upper...
Determine the number of carbons on the molecule using the mas spectra 43 100 90 80 70 60 50 40 30 39 20 10 74 27 m/z Values and Intensities: 161 38 351 39 21기 40 401 41 6781 42 5781 43 9861 44 45 311 46 Trl 50 101 51 이 52 리 53 1기 54 쾨 55 811 56 691 57 601 58 61 59 411 60 T 71 T1 72 Trl 73 74 16275 253 17 54...
Do the Academy Awards involve discrimination based on age? Listed below are the ages of actresses and actors at the times that they won Oscars in the Best Actress and Best Actor categories. the ages are listed in order, beginning with the first Academy Awards ceremony in 1928. (Note: in 1968 there was a tie in the Best Actress category, and the mean of the two ages is used; in 1932 there was a tie in the Best Actor category,...
Consider the following box-and-whisker plot. + HH 54 56 58 34 36 38 40 42 44 46 48 50 52 Determine the following values. Please type your solution in the text entry boxes provided a. The value of the minimum is (Use the form XX) b. The value of the first quartile is (Use the form XX) C. The value of the second quartile is (Use the form d. The value of the third quartile is (Use the form XX)...