Skip to content

Tag: python

alternative to if else python

Ok i wrote this in python then rewrote because i don’t like if else statements. the first version worked perfectly. my second one failed and ended up taking more lines than my first version. my question is, am i just stupid? is there a better way to do this or should i just accept the need for if else s…

Lag of values from 1 month ago

My initial dataset has only 2 columns, date and value. What I’m trying to do is, for each date, get the value from the previous month (columns m-1 and m-12). The problems I’m having is when the day doesn’t exist in previous month, like 29 of February, that I want to leave it empty, and most …

How to keep QWidgets in QTreeWidget hidden during resize?

I have a simple UI with QWidgets within a QTreeWidget. Some of them need to be hidden. Every time the application is resized, all QWidgets become visible. Below is a minimal example to demonstrate the issue. How can I make sure the QWidgets stay hidden until setVisible(True) is called explicitly? pyqt version…

Convert ’01-Feb-15′ to Python date 01/02/2015 [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 11 …

How to use pt file

I’m trying to make a currency recognition model and I did so using a dataset on kaggle and colab using yolov5 and I exactly carried out the steps explained on yolov5 github. At the end, I downloaded a .pt file which has the weights of the model and now I want to use it in python file to detect and