Questions tagged [drop]

468 questions
1
vote
1 answer

Why is df.drop dropping more rows than it should

I have a data frame (other_team_df) of premier league teams and I want to drop rows where the home team is either: Arsenal, Chelsea, Liverpool, Tottenham, Man City or Man United. When I run the code below, del_row_index has length=1596 and…
1
vote
2 answers

Drop rows in pandas dataframe depending on order and NaN

I am using pandas to import a dataframe, and want to drop certain rows before grouping the information. How do I go from the following (example): Name1 Name2 Name3 0 A1 B1 1 1 NaN NaN 2 2 NaN NaN 3 3 NaN B2 4 4 NaN NaN 5 5 …
chrundle
  • 13
  • 3
1
vote
1 answer

How to drop the last row of an exploded dataframe

I have a large dataframe, but to make this easy it looks something like this one below A B C 0 [a, b, c] 1 22 1 [d, e] 2 45 2 [f, g] 3 32 3 [h, i] 4 64 4 [j, k, l, m] 5 76 Now I have…
1
vote
1 answer

Liquibase -Drop Table Best Practice

in a DevOps (CI/CD) scenario, when Liquibase is triggered by a specific step of a pipeline, is a good practice that Liquibase drops all application ( microservice ) DB tables and recreate all DDL/DML using changesets (only for test and…
cyberdemon
  • 43
  • 2
  • 10
1
vote
0 answers

How to drop a constraint starting with number in postgresql ? For ex : 123_5_pk_not_null

While dropping constraint named 123_5_pk_not_null, I am getting syntax error at the start of constraint name. Query: alter table table_name drop constraint 123_5_pk_not_null; Error: Syntax error at or near 123 Need to drop the constraint
1
vote
1 answer

To change table schema in Databricks

Is there any way to change data type inside struct column in a table? Example: emp_details: struct emp_id: integer emp_name: string If emp_details is a column in a table which is of strict type and inside it emp_id and emp_name is present and I…
Farzu
  • 65
  • 5
1
vote
2 answers
1
vote
1 answer

Drop a row or observation by condition

Let's assume we have a dataframe df(1200, 20). Since I am only interested in 2 columns in the I will use only these in the following example index A B 1 Alex George 2 …
Alex
  • 149
  • 8
1
vote
0 answers

RobotFramework drag and drop to canvas not working for grapesjs

I am stuck with automation. I am using SeleniumLibrary for robot framework. We need this on Chrome browser. I am unable to drag and drop an element from parent to iframe/canvas using robot framework. The backend in on grapesjs. I guess this is not…
karthik
  • 11
  • 2
1
vote
4 answers

Drop rows containing string Pandas

I am trying to remove rows with an specific string only on a column, in a dataframe. I tought of using a combination of drop and iloc methods, because the column names are rather large and mutable and I am not interested in referencing the columns…
Ricardo Milhomem
  • 159
  • 2
  • 3
  • 11
1
vote
0 answers

Drag and Drop in cypress (trigger pointermove, {eventconstructor: PointerEvent}

I want to drag an object in cypress but after dragging i faced this error in cypress running window. Error is ( trigger pointermove, {eventconstructor: PointerEvent}) my code is type Url = string it('Drag', () => { cy.visit(url) …
Nazia Ali
  • 21
  • 4
1
vote
1 answer

Pandas compare columns and drop rows based on values in another column

Is there a way to drop values in one column based on comparison with another column? Assuming the columns are of equal length For example, iterate through each row and drop values in col1 greater than values in col2? Something like…
dinn_
  • 93
  • 1
  • 10
1
vote
2 answers

if column a == value, drop rows where column b equals

I am trying to drop rows in my df where SPCD == 104, drop rows where Age >= 950 and for some reason I can't for the life of me figure out how to do it. dropped_ages = d_age[ (d_age['SPCD'] == 104) & (d_age['Age'] >= 950) ] This is a line of code…
sarakota
  • 63
  • 1
  • 1
  • 6
1
vote
1 answer

How to remove next pandas dataframe row when it's equal to previous row only for some columns

I have created a dataframe called df with this code: # initialize list of lists data = {'ID': [1,2,3,4,5,6,7], 'feature1': [100,32,100,100,100,93,100], 'feature2': [100,32,100,100,100,93,100], 'feature3':…
Giampaolo Levorato
  • 1,055
  • 1
  • 8
  • 22
1
vote
2 answers

Drop rows where column duplicate and and other column null

Seeking to drop rows where col1 is duplicate and col2 is null, but only when both conditions are met. Therefore, where col1 is duplicate and col2 is not null, row should not be dropped. d = {'col1': ['A1', 'B4', 'A2', 'A1', 'B4', 'B4'], 'col2':…
Diop Chopra
  • 319
  • 3
  • 10