With this code (I added some prints to test where the code stops) I get this: do you have your details stored here already? y/n y Please enter a username Test debug: username_exists is True debug: I ran this command do you have your details stored here already? y/n Answer You’re initializing pass_matche…
Tag: python
Integrate Class
So I have been trying to create an integrate class for an assignment and while I have gotten a simple skeletal structure for the functions within said class, I keep on getting a None result, which really bugs me. The code that I have written down though is written below. What do I do to make this code work? A…
Can’t find and read .csv file
I recently brought my code from Jupyter into VSCode. I fixed up some problems with my imports, but now I can’t find a .csv file. The code and .csv file are saved in the same folder. My code is: After running the program, it says, What’s going on here? How can I fix it? It was working perfectly in …
How to change multiple buttons text using only one function, tkinter python
I would like to use only one function (self.toggle) for all of my buttons in my GUI instead of doing each for every button. I have tried to change name of self.button only without numbers and then I had text changing on just one button not the one required. Is there simple way to do just one function? I’…
Load existing data catalog programmatically
I want to write pytest unit test in Kedro 0.17.5. They need to perform integrity checks on dataframes created by the pipeline. These dataframes are specified in the catalog.yml and already persisted successfully using kedro run. The catalog.yml is in conf/base. I have a test module test_my_dataframe.py in src…
how to check non-empty selection?
I am using plotly-dash dropdown menu with multiple selection enabled. so the dropdown menu returned either an empty list when no selection, or a string ( with one selection) or list of strings ( with multiple selection). How do I check if returned is not empty? if I use below, it doesn’t work for empty …
ValueError: could not convert string to float when adding percentages
I’d like to change value in a dictionary which use string as value. Here is what I did: I got this error: What I expect is ‘padding-left’ becomes 12%+0.4=52% How can I accomplish this? Answer You can convert the digits to an integer and perform the addition: This outputs:
Tensorflow requires numpy version ~=1.19.2, matplotlib requires numpy version 1.23.0
I’d expect it to be a fairly common problem when installing a lot of python packages that there would be dependency collisions like package A depending on a certain version of package C and package B depending on another version of package C as a result of which both A and B cannot coexist in a project.…
How to avoid ElementClickInterceptedException when working with Selenium?
I use selenium with python and want to mark a checkbox by clicking on it. After having identified the <input> tag of the checkbox with selenium, I attempt to click on it with However, it throws the ElementClickInterceptedException. I identify the checkbox I want to click on through a loop. When I try to…
Add timedelta to a date column above weeks
How would I add 1 year to a column? I’ve tried using map and apply but I failed miserably. I also wonder why pl.date() accepts integers while it advertises that it only accepts str or pli.Expr. A small hack workaround is: but this won’t work for months or days. I can’t just add a number or I…