Skip to content

adding an assertion error for non numerical values

I am trying to add an additional assertion for values that aren’t numbers but I dont know how to go about it. I did try adding a and type(score) == float but it didn’t work, I received a value error saying a string cannot be converted to float. I just want the program to return the assertionerror …

comparing a number of lists in pairs

I have problem with 4 list each one got 4 number: P1= [3,1,3,4] P2= [5,4,3,7] P3= [7,4,8,1] P4= [10,3,2,1] I need to get the biggest number in combinational way like: Pair of 2: p1p2, p1p3, p1p4, p2p3, p2p4, p3p4 Pairs of 3: p1p2p3, p1p2p4, p1p3p4, p2p3p4 Pairs of 4: p1p2p3p4 The result for: p1p2= [5,4,3,7] p…

How to terminate simulation in SimPy 4

Is there a way to terminate the simpy simulation by using a command like env.exit()? I don’t understand how to place an event into env.run(until=event). I want to terminate the simulation when there are no objects left in my certain Simpy Stores. How can I do that? Answer Everything is an event in simpy…

Plot a Seaborn heatmap over a background picture

I have a following problem. I would like to plot my heatmap over an image. See my simplified code below: What is the problem here? Is it because the color for 0 values in my heatmap is black? I tried to follow answer here, but it did not work to me: Plotting seaborn heatmap on top of a background picture

PDF reading, returning empty rows

I have a function to read PDF as below: it is working fine on a normal PDF file (like books) I am able to extract the texts easily, but when I tried it at work on “meeting minutes” I got only empty lines like below: Very sorry that I can not share the original PDF however here is a picture