Skip to content

Tag: python

I can’t update the content of a Kivy label from Python

I state that this is the first time I use Kivy. The code I attached works, the only problem is that the lbl label does not update automatically but only if I press the update button. In practice, if I call the update_lbl function via the “update” button it works, when it is called automatically by…

I keep getting a TypeError and want the program to average a list

I keep getting the error – TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’ I have excluded most of the input code as it is long and not optimized. Answer it might be int(input()) not input(int()) instead. :D because int() is 0, but input() argument is a string not i…

Read, Split and Append csv to lists in python

Problem I need to build a backend function that will read the data within a csv file, split the values and append them to several lists. The program for adding/removing/displaying values form the lists is working but now I need to add file I/O. I have the file inventory.csv and have a function load_file_data(…

two conditions multiplication in pandas

I have the following dataframe, and I am trying to get revenue column by a multiplication between columnA or columnB and columnC. The condition is: if columnB is NaN, then the revenue column = columnA * columnC if columnB is not NaN, then the revenue column = columnB * columnC how do I get this revenue column…