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 1 y…
GroupBy Pandas with ratio
I am working on a dataset which looks something like this: I am trying to do 2 things: Find length of longest sequence of each type and find ratio of A/B and B/A for those sequences for each ID. Ratio attribute explanation: Calculate the total amount in the longest sequence for each ID(say length n). If the s…
Updating the json file edited in Python
Suppose I have a json file like – This is a single object. There are hundreds of objects similar to these. What i did was I accessed every ‘name’ from “name_list” and cleaned it using some rules. In that process some common name were removed. Now I want to update the cleaned data…
Remove trailing .0 from strings of entire DataFrame
Hi I would like to remove all “.0” at the end of a string for an entire DataFrame and I need it to be an exact match. Let’s make an example df: The desired output: I tried using replace but it didn’t work for some reason (I read maybe because replace only replaces entire strings and no…
How to display HTML Table data cell elements in Tkinter GUI using Selenium?
I want to make a program that takes the table data cell elements of tables from a wholesale website (the tables show stock of disposable vapes), and then will display which items are low on stock on a Tkinter GUI. So far I am using selenium to go to different URLs of various vapes and print out the stock of
Update SQLAlchemy column of my referral when my own column changes
Any time my wallet_1 is been modified with +1 or any value, I want to get the value and add it into the wallet_2 of my referral wallet which is (Joshua wallet_2) as well as for wallet_2, if my wallet_2 is been modified with +1 or any value, I want to get the value and add it into the wallet_3
How to reuse a root_validator in Pydantic?
The Pydantic docs have an example of reusing a validator: https://pydantic-docs.helpmanual.io/usage/validators/#reuse-validators Is it possible to reuse a root validator? Answer Yes, it is possible and the API is very similiar Example: It is also possible to parameterize the validator like in this example htt…
Selenium / More-Element clicking not possible allways?
I try to click on the more element on these pages – with the following code for the following link this works fine with finding element per xpath: But when i try the same code with another link / app like https://apps.apple.com/us/app/contacts-backup-pro-restore/id1120943403?uo=4 the more-element is not…
Automatic data wrangling on Pandas with multiple dataframes using lists and loops
for professional purposes I need to produce some reports that includes new entries every week. I have 16 dataframes having same column names (df names are week1, week2… week16). I created a list of the dataframes and then a loop. I wanted to test rename of column with index = 1 and I did not succeed. I …
Extract specific symbols from pandas cells, then replace them with values from a dict where they are keys
My data looks like this, well these are two of the columns: These are MSC codes, corresponding to different areas of science. I need to replace each code with the corresponding subject from this dict here: https://mathscinet.ams.org/msnhtml/msc2020.pdf , some of them are: “”” 00 General and …