Questions tagged [drop]
468 questions
3
votes
3 answers
Does the Drop trait in Rust modify scoping rules?
I'll use the CustomSmartPointer from The Book, which is used to explain the Drop trait, to build an example:
struct CustomSmartPointer {
data: String,
}
impl Drop for CustomSmartPointer {
fn drop(&mut self) {
println!("Dropping…

Martin Geisse
- 1,189
- 1
- 9
- 22
3
votes
2 answers
Python drop columns in string range
I want to drop all columns whose name starts by 'var' and whose content is 'None'.
Sample of my dataframe:
id var1 var2 newvar1 var3 var4 newvar2
1 x y dt None f None
Dataframe that I want:
id var1 var2 newvar1 var4 newvar2
1 x y…

MG Fern
- 75
- 9
3
votes
1 answer
Reindexing only valid with uniquely valued Index objects
Irun this code
esg_fm_barron = pd.concat([barron_clean.drop(columns = "10 year return", inplace = False),ESG_fixed.drop(columns = 'Name',inplace = False), financial_clean.drop(columns = 'Name',inplace = False)], axis = 'columns', join =…

Nader bouchnag
- 51
- 1
- 2
3
votes
3 answers
How to delete values from one pandas series that are common to another?
So I have a specific problem that needs to be solved. I need to DELETE elements present in one pandas series (ser1) that are common to another pandas series (ser2).
I have tried a bunch of things that do not work and the closest thing I was able to…

JacobMarlo
- 87
- 7
3
votes
1 answer
is anyone able to restrict the type of the objects dropped on the mac in SwiftUI 3?
as per the documentation, it should be pretty straightforward. example for a List: https://developer.apple.com/documentation/swiftui/list/ondrop(of:istargeted:perform:)-75hvy#
the UTType should be the parameter restricting what a SwiftUI object can…

godbout
- 1,765
- 1
- 12
- 11
3
votes
1 answer
Can one drop rows in a dataframe based on nunique values?
I want to ignore the rows is the occupation has less than 2 unique names:
name value occupation
a 23 mechanic
a 24 mechanic
b 30 mechanic
c 40 mechanic
c …

futuredataengineer
- 442
- 1
- 3
- 14
3
votes
1 answer
TypeORM migration:generate working great except for DROP
I have a NestJS / TypeORM Project with PostGRE SQL.
I want to delete some tables, so I have deleted the concerned folders. I also removed the dist folder to build the project again but even with that, typeORM does not detect that it have to DROP…

Alexy
- 780
- 6
- 22
3
votes
3 answers
Drop a row based on empty/blanks values in specific column in final excel file - Pandas Data frame
I am trying to drop rows based on the empty values in a specific column of excel after joining the data for both excels. I have tried some queries mentioned in stack overflow, but the desire results are not achieved. Kindly support and thanks
First…

aza01
- 95
- 1
- 1
- 7
3
votes
2 answers
Unable to drop columns from a pandas dataframe
I am trying to drop a column from a pandas dataframe as follows:
df = pd.read_csv('Caravan_Dataset.csv')
X = df.drop('Purchase',axis=1)
y = df['Purchase']
but it does not work.
I also tried the following one:
df =…

Tugba Delice
- 31
- 1
- 2
3
votes
1 answer
Drop column with low variance in pandas
I'm trying to drop columns in my pandas dataframe with 0 variance.
I'm sure this has been answered somewhere but I had a lot of trouble finding a thread on it. I found this thread, however when I tried the solution for my dataframe, baseline with…

hex93
- 319
- 3
- 15
3
votes
1 answer
Drag and drop, catalyst
I'm trying to use the drag and drop methods to drag an .mp3 file from finder into my app (using mac catalyst). So far I have succeeded in getting (I guess) the raw data from the mp3 file into an array, but I'm not sure how to proceed. What I…

patturik
- 135
- 1
- 8
3
votes
2 answers
Removing columns in a nested struct in a spark dataframe using PySpark (details in text)
I know that I've asked a similar question here but that was for row filtering. This time I am trying to drop columns instead. I tried to implement Higher Order Functions such as FILTER and others for a while but could not get it to work. I think…

Rajiv Krishnakumar
- 189
- 1
- 9
2
votes
1 answer
Drop SSIS Proxy Credential
I am trying to drop a credential using this query:
if exists (select * from sys.credentials where name = 'SSISProxyCredentials_ABC')
drop credential SSISProxyCredentials_ABC
But I am getting an error message saying:
Msg 15541, Level 16, State…

Trying to be DBA
- 25
- 3
2
votes
1 answer
Why elements should be dropped before dropping vec in rust
I am trying to implement a vector. I found this code where the writer deallocates a vector:
impl Drop for MyVec {
fn drop(&mut self) {
if self.cap != 0 {
while let Some(_) = self.pop() { }
let layout =…

user19291301
- 127
- 8
2
votes
1 answer
PhantomData seems not work for dropck in rust
use core::marker::PhantomData;
fn main() {
struct Inspector<'a>(&'a u8);
impl<'a> Drop for Inspector<'a> {
fn drop(&mut self) {
println!("I was only {} days from retirement!", self.0);
}
}
struct…

dd.ho
- 79
- 4