Questions tagged [drop]

468 questions
2
votes
0 answers

How can I know the reason why drop() has not been called in Rust?

impl Drop for DBWrapper { fn drop(&mut self) { if util::fs::exists(self.path.as_str()) { DB::destroy(&DBOptions::new(), self.path.as_str()).expect("destroy failed"); } } I use Drop trait to delete data after no one was using…
Tian Li
  • 66
  • 6
2
votes
2 answers

How to drop rows from Dataframe where values in 2 columns are the sam?

My DF looks like below Date New_date X Y 01-12 01-12 3 4 01-13 01-13 6 1 01-14 01.15 2 3 I need this result: Date New_date X Y 01-14 01.15 2 3 o code should remove first 2 rows because values in columns Date and New_date…
Tmiskiewicz
  • 389
  • 1
  • 11
2
votes
3 answers

using R: drop rows efficiently based on different conditions

Considering this sample df<-{data.frame(v0=c(1, 2, 5, 1, 2, 0, 1, 2, 2, 2, 5),v1=c('a', 'a', 'a', 'b', 'b', 'c', 'c', 'b', 'b', 'a', 'a'), v2=c(0, 10, 5, 1, 8, 5,10, 3, 3, 1, 5))} For a large dataframe: if v0>4, drop all the rows containing…
ie-con
  • 53
  • 4
2
votes
0 answers

How to add drop event to Vuetify calendar

I need to drag an event from outside to v-calendar. But, Vuetify does not have drop event. How can I add drop event to Vuetify? As you see in the below screenshot, I have two tasks above the calendar and I want to add them to the "Vuetify"…
morteza mortezaie
  • 1,002
  • 14
  • 37
2
votes
1 answer

How to DROP TABLE based on a pattern in MySQL?

so here is my database. +------------------------+ | Tables_in_homestead | +------------------------+ | 10_UsercardTB | | 1_UsercardTB | | 3_UsercardTB | | 4_UsercardTB | | 5_UsercardTB | |…
2
votes
2 answers

How to drop NaN from one column according to another columns specific value

Can't figure out how to drop NaN values from specific column according to another column specific value. Part of DataFrame(df): vol. group 1186 10,448,898 1 1187 nan 0 1188 35,047,520 …
unkind58
  • 117
  • 2
  • 11
2
votes
2 answers

Simulating drag event of files dragged into browser

When you drag files from desktop to browser you can retrieve files as 'FileEntry' using evt.dataTransfer.items[i].webkitGetAsEntry() However I'm interested is it possible to create this event programatically: to transfer files (blob or created with…
2
votes
2 answers

How do I drop columns in a pandas dataframe based on the count of NaN

Is there an easy way to drop columns that are predominately NaN? I have a dataframe with 129 columns, I would like to drop all columns with 50% or greater NaN values.
2
votes
0 answers

How to parse multiple file name arguments passed to a Windows batch (.BAT) file with file name containing commas?

I'm trying to echo files dropped on a batch file using command FOR, but this method is broken if a file has commas , in it's name. Example of files being dropped: Testfile.txt Pictures,photos,GIFS.zip Personal documents.7z Code: for %%a in (%*) do…
2
votes
1 answer

How to delete 1 table if another table exists in PostgreSQL using IF-statements

I'm trying to write a query that deletes/drops a table, if another table exists: DO $do$ BEGIN IF EXISTS (SELECT FROM table1) THEN DELETE FROM table2; END IF; END $do$; but all that it is doing is deleting rows from table1 if table2…
2
votes
2 answers

How do I delete a row of indexes with the starting and ending index in a dataframe(python)?

For example: INDEX FRUIT 0: "banana" 1: "apple" 2: "donut" 3: "pizza" 4: "noodles" 5: "ice-cream" 6: "grapefruit" Usually, in order to drop rows 2-5 inclusive, I use drop.(df.index[[2,3,4,5]])…
2
votes
3 answers

How to filter multiyear dataframe to retain rows with values in all years

I have a multiyear daily dataframe which has different entities(Col1) present in different years (Col2). I am trying to filter the data frame such that it retains only those rows which have a value in each of the specified year. (I have created Col2…
2
votes
3 answers

Drop the smallest value from pandas Series

I have a pandas.Series: Name: vector, dtype: float64 1 74.67 2 87.78 3 97.00 I want to drop the smallest value from Series. I managed to do: vector = vector[vector != vector.min()] But what if my Series has got somewhat identical the…
Yaroslav Hladkyi
  • 305
  • 2
  • 13
2
votes
3 answers

Drop rows in spark which dont follow schema

currently, schema for my table is: root |-- product_id: integer (nullable = true) |-- product_name: string (nullable = true) |-- aisle_id: string (nullable = true) |-- department_id: string (nullable = true) I want to apply the below schema on…
2
votes
1 answer

Dropping NaN values from columns in stacked arrays

I've got an array with three rows and about 25000 columns. I'm trying to drop those columns that have NaN values in any of the three columns, but struggling at doing so. So far I've managed to do the following which manages to drop rows with NaN…