Questions tagged [drop]
468 questions
2
votes
1 answer
Automatically DROP FUNCTION when DROP TABLE on POSTGRESQL 11.7
I'm trying to, somehow, trigger a automatic function drop when a table is dropped and I can't figure out how to do it.
TL;DR: Is there a way to trigger a function drop when a specific table is dropped? (POSTGRESQL 11.7)
Detailed explanation
I'll…

NelsonC
- 53
- 1
- 6
2
votes
3 answers
drop_duplicates() got an unexpected keyword argument 'ignore_index'
In my machine, the code can run normally. But in my friend's machine, there is an error about drop_duplicates(). The error type is the same as the title.

Wzh
- 21
- 1
- 3
1
vote
1 answer
Is there a good way to drop coefficients of a Julia polynomial
I am doing computations with Julia polynomials of rationals. After an operation I might have a polynomial of high degree, I want to truncate to a polynomial of a smaller degree by throwing out the higher order terms. I figured out a solution below.…

Josh
- 11
- 2
1
vote
1 answer
Uploading a file with drop
I need to drag a file and collect its information: get its name and pass its content to Base64. When uploading the document doing the drop I get an error "Cannot read properties of undefined (reading 'type')" when I get to the…

peips
- 33
- 8
1
vote
1 answer
In python, drop a time range period
I would like to drop 30 minutes of data after column is -1.
I have a large dataset and I need to remove 30 minutes from the dataframe after the column 'diff' == -1
I have the following code:
df12_3.head()
index Timestamp Status_flag…

lourew
- 65
- 1
- 1
- 7
1
vote
1 answer
Why can't I use the Deref trait inside Drop in Rust?
I implemented the Deref trait for the MyString struct which allows me to use an object of type MyString via *o or o.deref().
But when I implement the Drop trait for MyString then the already implemented Deref trait cannot be used inside the Drop…

Frank Schwidom
- 47
- 5
1
vote
1 answer
Need help dropping variables in SAS with same suffix
NOTE: Invalid argument 2 to function SUBSTR. Missing values may be generated.
NOTE: No rows were selected.
%let suffix=_mic;
proc sql noprint;
select name into :_mic separated by ' '
from dictionary.columns
where…

Tia
- 23
- 3
1
vote
1 answer
How to remove pandas dataframe records by key and subject to condition
I have a pandas dataframe that I have created as follows:
import pandas as pd
ds1 = {'col1':[1,1,1,1,1,1,1, 2,2,2,2,2,2,2], "col2" : [1,1,0,1,1,1,1,1,1,0,1,1,1,1]}
df1 = pd.DataFrame(data=ds1)
print(df1)
col1 col2
0 1 1
1 1 …

Giampaolo Levorato
- 1,055
- 1
- 8
- 22
1
vote
3 answers
How to remove subsequent records in pandas dataframe subject to condition
I have a pandas dataframe that I have created as follows:
import pandas as pd
ds1 = {'col1':[1,2,3,4,5,6,7], "col2" : [1,1,0,1,1,1,1]}
df1 = pd.DataFrame(data=ds1)
The dataframe looks like this:
print(df1)
col1 col2
0 1 1
1 2 …

Giampaolo Levorato
- 1,055
- 1
- 8
- 22
1
vote
1 answer
How to "capture" drop multiple columns in pandas
I know one can drop multiple columns with
df.drop(columns=['col1', 'col2'],inplace=True)
I want to drop only if a column exists without throwing an error if it does not.
For example, if only col2 exists, it should only drop col2. I know this can be…

John s
- 164
- 7
1
vote
2 answers
How to rewrite dropWhile in java 8?
As you know, dropWhile for streams was introduced in java 9. But if the target of the project is java 8, you can't use it.
Example code:
public static String getParameterValueOrDefault(String[] args, String paramName, String defaultVal) {
return…

PatoOta
- 11
- 3
1
vote
1 answer
Implementing Drop for a Future in Rust
I have an async function (let's call is my_async_fn) that should support cancellation (I want to allow the caller to use tokio::time::timeout or futures::future::select with my_async_fn). I also need to perform some cleanup, regardless of whether…

Adrodoc
- 673
- 10
- 19
1
vote
2 answers
drop rows in Groupby python
I want to get result
df3=df.groupby(['Region']).apply(lambda x: x[x['Region'].isin(["North", "East"])]['Sales'].sum()).reset_index(name='sum')
Region sum
0 East 455.0
1 North 665.0
2 South 0.0
3 West 0.0
I want to do…

월봉리
- 11
- 2
1
vote
1 answer
Drop rows of tuples containing null value
I have a data table with containing tuples of words. I want to drop the rows (pf tuple) that contains no words ("[]"). Here's what my data looks like, in which I expect 3rd row to be removed in the new dataset.
stemming
0 …

Dewani
- 137
- 6
1
vote
3 answers
R: How to drop the corresponding rows if there is a 1 in columns with a column name containing a specific string
I would like to drop a whole row if there is a 1 in any column having a name that ends with "rem" or "nocut".
Sorry, I can't list the whole data set here because it's too large.
Here is an example of my data:
Sequence| #1C_cut | #2C_nocut | #1C_rem…

caramel
- 13
- 2