Skip to content

How to print OKAY if required variables are not empty?

As of my example code it is printing okay. But it should be print Okay either both d,e and f are should be empty or both should not to be empty. For example if a,b and c are not empty and d,e and f are empty then it should be print “okay”. And a, b, c are not empty and

set an index while merging two dataframe

I have a dataframe like this : dte res year 1995-01-01 65.3 1995 1995-01-02 65.5 1995 … … … 2019-01-03 55.2 2019 2019-01-04 52.2 2019 and I’m trying to create another file in this format : basically I want every year in a different column. Here is what I already did : when I write in m…

Switching to Pyomo – Syntax issue with sets

I have used the algebraic modelling language AMPL but I’m now making the switch to python and Pyomo. I’m struggling a bit with its syntax though. In AMPL I would have something like this: How can I implement the last line in Pyomo? Any help is much appreciated, thank you! Best regards, Johannes An…

How can a object detect the mouse in pygame

I have here the bubbles class and i want to do it that when you click a bubble it despawns but i dont know how the bubbles detect the mouse cursor and how the bubbles despawn. I already tried to add the mouse position function but I dont know hot to use it. And I searched on the Internet but