Skip to content

Tag: python

Why is my with statement skipped after while loop?

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…

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 …

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 …