I’m using a generic local crud so i can implement the same method for every single list, but when trying to add a value to a list it doesn’t update the root list but the parameter one does, any help? If i print the parameter “lista” when appends the new value it returns the list with t…
Tag: python-3.x
Python DataFrame: Map two dataframes based on day of month?
I have two dataframes. month_data dataframe has days from start of the month to the end. student_df with each student’s only present data. I’m trying to map both dataframes so that the remaining days left for each student should be marked as absent month_data month_data = pd.DataFrame({‘day_…
Function to get user_id’s that had their opt-in status changed after processing of the change log
Given a list of users with their opt-in statuses and sequential change log of opt-in status updates that is applied to user list, I am trying to write a function to get a list of all user_ids (sorted by id) that had their opt-in status changed after processing of the change log Sample Input: Sample Output My …
Python, random.randint does not print out
this is the code down below I am not sure if of the 22 variables it does not guess the number or have I done something wrong if you are reading this, Thank you so much for just attempting to help someone! you are a good person and are willing to help others Answer its very good to explain what
How can I wrap all BeautifulSoup existing find/select methods in order to add additional logic and parameters?
I have a repetitive sanity-check process I go through with most calls to a BeautifulSoup object where I: Make the function call (.find, .find_all, .select_one, and .select mostly) Check to make sure the element(s) were found If not found, I raise a custom MissingHTMLTagError, stopping the process there. Attem…
QGraphicsItem don’t change pen of parent when chaning child
I have a multiple QGraphicsItems that are in a parent-child hierarchy. I’m trying to get highlighting of an item on mouse hover to work on an item basis, meaning that if the mouse hovers over an item it should highlight. The highlighting works fine, but if I’m performing the highlighting on a chil…
Concurrency for requests
I have a python script and I’m sending post requests to same url with different data(different ids). I have to send requests for each id and check them continuously to see if there is a change. I’m handling it with iterating an “ids” list with for loop and sending request for each id a…
Converting linreg function from pinescript to Python?
I am trying to convert a TradingView indicator into Python (also using pandas to store its result). This is the indicator public code I want to convert into a python indicator: https://www.tradingview.com/script/sU9molfV/ And I am stuck creating that pine script linereg default function. This is the fragment …
Qiskit and IPython conf files do not exist
I had installed the qiskit-textbook distribution of Qiskit using this command : pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src The tutorial then said to change the contents of the configuration file located at ~/.qiskit/settings.conf but I can’t …
How to preserve original color coding of output on the shell while doing a subprocess.Popen?
I have a simple Python script which live-prints the output of a command. Following is the script: The script works well for what it should do but it loses color coding of the output on my shell. If I type ls -la, I get the output well-colored. But if I run the above Python script, it gives the output uncolore…