Questions tagged [remove-if]

Common Lisp 'remove-if' function.

Common Lisp 'remove-if' function.

It's signature is:

remove-if test sequence &key from-end start end count key => result-sequence

CLHS: remove-if

201 questions
0
votes
1 answer

How to use properly remove() for sets in python?

My example is pretty simple, but still: a have a set called basket with n elements (we enter n and then the elements). And what I want is to remove all elements with 'apple' in them. However there can be cases where there is no 'apple' in the set at…
0
votes
1 answer

How to remove values from column on condition or first check and then add data to dataframe?

I am trying to remove values from column2 and column3 under condition that there are values in the column1 (but we have to check it for each row). I've tried many things but it was removing all data from column2 and column3. Could you help me solve…
Ozar
  • 1
  • 1
0
votes
0 answers

batch script to find special characters in CSV file and remove leaving remaining text in field

Not looking for someone to provide a full script (unless someone wants to be kind enough to do so) looking to figure our or get some direction (after searching on the internet and not finding answers) as to how to search an excel CSV file for…
Midnite
  • 1
  • 3
0
votes
1 answer

Remove rtf formatting from string

I need to subtract text from string with rtf format. I have a string in rtf format std::wstring sString= L"{\\rtf1\\ansi\\ansicpg1252\\deff0\\nouicompat\\deflang2057{\\fonttbl{\\f0\\fnil\\fprq12\\fcharset0 Times New Roman;}}\r\n{\\*\\generator…
0
votes
2 answers

remove a value with its counterpart conditional on an ID

I have the following data frame neto damo 356 008 -356 008 -175 009 700 009 -700 009 250 009 -36 018 -36 018 -36 018 I want to eliminate the data with its counterpart conditioned to the ID and that it looks like…
0
votes
2 answers

Delete Lines from table if the sum of multiple lines is Nil (based on criteria)

I'm working with the following table where you can get activity from customer purchases. DateOfActivity CustomerReference Reference Line Description Receivable Amount 24/10/2022 CUST567 1 Credit Purchase 20,000 24/10/2022 CUST567 4 Credit…
saashe
  • 7
  • 3
0
votes
0 answers

Does using removeIf() on an ArrayBlockingQueue trigger a put() call from another thread?

I'm trying to remove elements manually from ArrayBlockingQueue by using the removeIf() method, using threads. And then have another thread trying to put an element into the ArrayBlockingQueue. It doesn't work, which is weird because I thought that…
0
votes
0 answers

Deleting rows with PhpSpreadsheet

I am struggling to find a way to totally remove empty rows from a financial spreadsheet that is created from db results (loop); I need to remove / delete rows with a calculated row total that equals 0, I first tried hiding rows that have a zero…
0
votes
2 answers

Can someone explain why this doesn't remove all values less than limit?

#include #include #include int removeLessThan(std::vector& v, int limit) { std::remove_if(v.begin(), v.end(), [limit](int a){return a < limit;}); return EXIT_SUCCESS; } My output: Vector after removing all…
0
votes
1 answer

R - sub to remove the special character if in first position

I would like to remove the symbol "|" but only when it is at the beginning of a sentence (e.g., I want "|pediatrics" to become "pediatrics" but "pediatrics|clinical" should not be changed. I tried sub('[|[:alnum:]]','', "word") which works well in…
ClaraJ
  • 57
  • 4
0
votes
0 answers

How can I remove elements from a tensor based on index

I want to use a two path CNN for image processing. I want to concatenate both models after a flatten layer. When I calculate the difference between the elements of the two flatten layer, I want to delete the elements that are equal. I am…
0
votes
3 answers

R str_replace / remove access zeros in string after the decimal seperator, (zero following dot[1-9]) gesub, regex, regular expression

I have vector of strings containing numbers. Within these strings, I would like to remove all access zeros behind the decimal separator. So I tried mutate_all(funs(str_replace(., ".00", ""))). This works for the first number in my vector: v <-…
MsGISRocker
  • 588
  • 4
  • 21
0
votes
1 answer

Remove elements within a list of indexes in python

I have a list of values: list_of_value = [1,3,4,2,3,"start",3,4,5,"stop",5,6,7,6,"start",5,6,7,"stop"] I need to remove from the list the elements between "start" and "stop" (boundaries included). The output should be something…
0
votes
2 answers

How to remove part of characters in data frame column

I have a data frame as follows (part of a larger set): data frame for the column raw$Zipcode I need to remove the two 00 before the Zipcode number for Swedish zipcodes (preferably through a function). I am very new to R and have found gsub and…
Brune
  • 15
  • 3
0
votes
2 answers

given list of grades

This is the code I have made, however, what is being displayed is incorrect. Kindly teach me what do I need to fix. #include #include using namespace std; bool check(int passing){ int g; if(g<=passing){ return…
trese
  • 15
  • 5