發表文章

目前顯示的是 11月 17, 2018的文章

Average multiple scores of the same topic

圖片
up vote 0 down vote favorite 1 Say I have a spreadsheet that contains quizzes taken by students and their scores. I want to create another table of that data the gives me an average of 2 quizzes that are related to the same topic. I have attached an example. Not all topics contain two different quizzes, some just consist of one single quiz. Maybe someone could help me solve this. enter image description here I tried to use a pivot table but it creates a column for each test, not exactly what I need. excel google-sheets excel-formula share | improve this question asked Nov 10 at 16:10 Firefox17 10 3 So have you tried AVERAGEIFS() ? – Solar Mike Nov 10 at 16:17 @SolarMike I couldn't find an example of a similar use of AVERAGEIFS() – Firefox17 Nov 10 at 17:02 Well, the answer shown does a good job, it’s also in the excel help. – Solar Mike Nov 10 at 17:16 add a comment  |  up vote 0 down vot

I have a recursion limit error in my quick sort program although I set recursion limit to 1500

圖片
up vote -1 down vote favorite I am trying to write an in-place program that would use the quicksort algorithm to sort a list. But it keeps giving an error: maximum recursion depth exceeded while calling python object. Although I tried setting recursion limit. def partition(L,low,high,comparison): i=low-1 pivot=random_pivot(L) for j in range(low,high): if comparison(L[j],pivot): i+=1 L[i],L[j]=L[j],L[i] L[i+1],L[high]=L[high],L[i+1] return i+1 def inplace_Quicksort(L,low,high,comparison): low=0 high=len(L)-1 if comparison(low,high): pivot_index=partition(L,low,high,comparison) inplace_Quicksort(L,low,pivot_index-1,comparison) inplace_Quicksort(L,pivot_index+1,high,comparison) print(L) Can you please have a look at it and explain to me what is wrong? Thank you so much. python sorting quicksort share | improve this question edited Nov 10 at 19:44 Strawberryshrub 778 2 15 asked Nov 10 at 16:11 Asmaa Hadir 1 1 T