Skip to content

Tag: python

calculate sum of squares with rows above

I have a dataset that looks like this: I want to iterate through each row and calculate a sum of squares value for each row above (only if the Type matches). I want to put this value in the X.sq column. So for example, in the first row, there’s nothing above. So only (-1.975767 x -1.975767). In the seco…

How to make odoo progress bar use decimal?

So I am learning odoo right now, and I want to make the progress bar that use decimal to determine it’s percentage. so for example if I input a 0.5, the progress bar will show 50%, so I don’t have to input 50 to get 50%. I tried using options like below PY XML but the output is either 0/1

Python Snake Game snake does not follow

I am creating Snake game in pygame using Sprite logic how do i chain the movement of the snake? another question on this has been answered here but i cant apply it to my code: see here the minimal example above works. try it first and you will see my issue :) the snake grows on collision with the red