I have a file (CSV) containing data that looks something like this in a table format: ID employee date value1 value2 1 a 2022-01-01 123 456 2 b 2022-01-01 123 456 3 a 2022-01-01 123 456 4 c 2022-01-01 123 456 5 d 2022-01-01 123 456 6 b 2022-01-01 123 456 7 e 2022-01-01 123 456 8 e 2022-01-01 123
Tag: python
I’m trying to write a simple whatsapp bot with selenium but the messaging loop won’t work properly. What is the problem?
Answer In your code, you’re calling textbar.send_keys(message) before checking if the message is exit. You should move up your if statement so that you exit the program sooner. And put the find_element inside the loop to avoid StaleElementReferenceException. Eg:
XML parsing in python issue using elementTree
I need to parse a soap response and convert to a text file. I am trying to parse the values as detailed below. I am using ElementTree in python I have the below xml response which I need to parse I need to use the below code snippet. The issue is that The below code is not able to find
How to reshape data delimited with whitespaces but with headers that can’t be delimited by white space
I’ve a simulation result for an antenna result as it can be found in here You can see that I need to reshape this data so three things happen: The headers are kept on the format Var(extraInfo)[unit] where the parenthesis can be sometimes optional as seen from the first column and third column The second…
ezDXF: Can i set a text style inside a BLOCK?
When I try to set up a text style inside a BLOCK, TrueView stops with an error. If I remove the style line the DXF is accepted Its an Autocad limitation or a non implemented feature in ezDXF? I have no full Autocad available for checking… Answer Any text style you want to use must be defined in the DXF
Python pandas trying to get Cummin but get a zero value
I want to use cummin but it doesnt work, It shows zero, cummax work well. my code: original df: my result : Answer It is expected, because after shift first value is 0, so after cummin is here always 0 (until negative value): Remove fill_value=0 for NaN instead 0 for first value in Series.shift, last if neces…
How to click on a button on a webpage and iterate through contents after clicking on button using python selenium
I am using Python Selenium to web scrape from https://finance.yahoo.com/quote/AAPL/balance-sheet?p=AAPL but I want to scrape the Quarterly data instead of the Annual after clicking on the “Quarterly” button on the top right. This is my code so far: I am able to get the button to click but when I i…
Trying to change my code to include loops and listed variables to make more streamline and expandable code
I made a prior discussion where I was unable to properly explain myself. This is my most up to date code that does what I want with 3 items. I would like to turn this into a function using a list so that it can ask how many items you want to use and then run the code that I
Using Split method or Regex to separate string
In my project I am webscrapping UFC website to gather to the total wins, total losses, and total draws of each UFC athlete. This is part of my code, as I wish to strip the total wins, total losses, and total draws separately: The result is the following: The problem is, I am unable to spew out the total draws…
How can I make the tkinter window fixed?
This is my current code, and I am struggling to understand where I need to put additional code to make sure that my tkinter window is fixed. Code taken from: https://pythonprogramming.net/change-show-new-frame-tkinter/ Answer As mentioned in the comments, you simply need to set your root window resizable meth…