I try to make a python script that gets the dam occupancy rates from a website. Here is the code: The output is like this: Genel Doluluk Oranı means occupancy rate. I need the value of occupancy rate which writes in next line like 29,48. How can I get this value from output? Answer Cause question and expected result is
How to merge two rows of a pandas dataframe depending on a condition in Python?
I have a dataframe : Index 2 and 3 have the same product id’s, hence its the same order, so i am trying to combine the rows into one single row, to get : the final df being : I have tried using df.groupby function : But it throws datatype error Answer The output is:
Why does Python not read the next line (if)?
I wrote the program about Pythagorean I got my answer but python doesn’t read (break) after (if) . My program title : (Special Pythagorean triplet), there is a one answer exist for ((a+b+c=1000)&(a**2 + b**2 =c**2) ) I want find abc . I know (a=200, b=375, c=425) but when program starts it never stop and it continue. It also types
Python filter from Excel
I am working on to create a python automation program for Excel. I wanted to divide the longitude based on the median number. What I want to get data is : Below is my code: Below is the output from this code. output above the output is show all longitude in United States. However, I want to filter only 1.
ActionChain click() returning Web Element instead of clicking
I was wondering how to simulate a button click on a login page using Selenium. When I try the following, it gives me an error saying that the button is not clickable at the coordinates listed (635, 353). When I try using an ActionChain, it returns the Web Element (the button that’s supposed to be clicked) rather click. Answer I
Nested if statement returns no such item
my scipt is working as in searching for zip files, unzip and do the things i want. But problem arise when i have nested zip files inside the zip file, so i thought maybe i copy the working if statement, make a few adjustments but i still cant get it to work. what i want to achieve is to simply
How can I handle “Reindexing only valid with uniquely valued Index objects”
I have a dataframe of names (df): And a schedule dataframe (df1): I pivoted df1 (df1_pivoted) to put assignments in the df1 columns: I then try to add the names back in, but I can not figure out how to deal with the “Reindexing only valid with uniquely valued Index objects” error. I presume it is because some names are
Python: Get randomised mode from list of lists
When I use this function to calculate the randomised mode from a normal list it works fine. However I need to get the randomised mode from a list of lists and this function below only returns the last number in matrix even though it is not the mode. How would i solve this issue? Note: I am only allowed one
Discord.py ping command doesn’t work in a cog
My ping command doesn’t work in a cog but works in my main.py file. Here’s the code for the cog: When I run the ping command I get this error: Answer Simple solution, you added bot to your class object Misc as self.bot so when referring to bot.latency in that context you should actually be using self.bot.latency.
How to Drop rows in DataFrame by conditions on column values
I created code to drop some rows according to certain condition : but I got this error: AttributeError: ‘NoneType’ object has no attribute ‘head’ Answer Assign df_clean to df2 without the inplace Or leave the inplace without assigning, here df_clean will be your output