15,743,876 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by A v Nov2021 (Top 9 by date)
A v Nov2021
2-Jun-22 9:12am
View
Can you help me solve this
A v Nov2021
2-Jun-22 9:07am
View
Thank you! But your code does not eliminate anything in the first pass
A v Nov2021
2-Jun-22 8:53am
View
will modify the question in a application perspective for better clarity. Sorry for my bad presentation skills.
Lets say this is our dataframe df =pd.DataFrame({'resources'[100,200,300,300,400,400,400,500,1000],'score': [1,2,1,2,3,5,6,8,9]})
I want to find a trade-off with resources i use and my score. My priority is to get the best score with less resources. I iterate all combinations and see if a row is eligible to be considered. So basically in this 9 rows, rows 3, 4, 5,6 should be eliminated 3 because 1 gives the same score with less resource, 4 because 2 gives the same score with less resource, 5 and 6 because 7 gives a better score with same resource. I hope this will make my problem more clear
A v Nov2021
2-Jun-22 5:05am
View
I cannot find the libraries that help me do it. How do I loop through and drop?
df = pd.DataFrame({'A': [1,4,4,3,7],
'B': [1,2,2,6,4],
'C ': range(10, 5, -1)})
df2= df.drop(df[(df['A'] < df['A']) & (df['B'] > df['B'])].index)
This code does not work for me.
A v Nov2021
2-Jun-22 4:34am
View
I do not have a code. I don't know how to implement this logic in python. I start with the first row and check all other rows if there is a higher A value "AND" lower B value, if this is not satisfied I dont drop that row. Here, for the first row there are higher A value but no value is lower than the 1 in B so it should not be dropped. Likewise, iterate all rows.
When doing like this row 4 is dropped because it can see there are higher values than 3 in A and lower values than 6 in B .
A v Nov2021
16-Nov-21 11:42am
View
Hello! Thanks to you! I am able to implement both.
A v Nov2021
15-Nov-21 14:41pm
View
Hi all! Thanks for the inputs, I am just beginning my scripting journey. And yes, it is for a school project.
A v Nov2021
14-Nov-21 8:59am
View
I understand the logic, but I don't know how to implement it. I am a naive programmer. The above code snipet is also from the internet.
A v Nov2021
14-Nov-21 8:39am
View
The current script throws a output as (e+g)+(f+h) but i need all elements of e, g, f h too like the desired output i have mentioned. How to modify this script?
Show More