I have a pandas data frame which looks like this Name Index1 Index2 AAA 67 70 Aaa 55 80 Abb 32 20 BBB 84 45 Baa 80 70 Bbb 13 40 where some rows have names with all uppercase and some with lowercase. How can i create another dataframe with only the uppercase rows expected output will be : Name
Tag: python
Pass/Refer a SQL file in Apache Beam instead of string
I’m trying to run a simple Beam pipeline to extract data from a BQ table using SQL and push to a GCS bucket. My requirement is to pass the SQL from a file (a simple .sql file) and not as a string. I want to modularize the SQL. So far, I’ve tried the following option – it did not work:
Send a email already created in a window with a macro Outlook Python
I’m trying to automatize Outlook with python with win32com.client in python. I have already a Macro that creates me a email, with all the subject and attached files. The problem is that when I try to automatize it with Python, i don’t know how to select the window that the macro open with all the …
Extract full text from different tags and outside them
I want to extract all text information from the already scrapped readme files from github. There is text between Html tags but there is also a lot of text outside (between) tags. Tags are different because those are different readmes so the authors do not follow any particular rules. I want to extract text fr…
Is there a performance deficit not splitting endpoints in Flask?
Just a question as to whether, for example, the following code would be faster in the second format rather than the first. Currently I am using the first example (with around 10 different options) and am wondering whether it would improve performance to split up the end point as in the second example. First e…
Check values greater than int with condition Pandas
Say, I have this dataframe: t = pd.DataFrame(data={“Pos”: [1, 2, 3], “A”: [10, 2, 90], “B”:[90, 98, 10]}) I would like to know which of the (values in A and B >= 20) but only if (Pos = 1 or 3). The result should look like this: I can find the values >= 20 using t[[…
How do I apply Sympy.Solve to solve a two-sided function on each row in a database?
I am attempting to apply the sympy.solve function to each row in a DataFrame using each column a different variable. I have managed to solve for the undefined variable I need to calculate — λ — using the following code: However, I need to apply this function to every row in a DataFrame and output …
Mutiple style for one DataFrame issues
I would like to understand how “style” works in python, I always have the same error : AttributeError: ‘Styler’ object has no attribute …. for now, I manage to have : the first row in yellow but not the conditional formatting (df_x0) and the conditional formatting blue and orange…
How to terminate wait_for() when a condition is no longer met?
My discord.py command for a bot is supposed to activate a while loop under the condition that a specific variable has a certain value (with a wait_for() coroutine within it): It only executes while cond is True, however cond can change while wait_for() is running (I used a global variable for the example), an…
Pandas merge only on where condition
Please help with logic on applying merge function only where condition is met. In below example: merge should be applicable only when, np.where name = John, else show 0 Expected result: TIA Answer use merge and select the good rows of your df2.