Questions tagged [drop]

468 questions
0
votes
1 answer

sqlalchemy drop table issues

I am working on some Python code to create and drop some database tables. The code to create the table is working correctly, however I am having issues with the drop table code. Here is my stack info: Python 3.8 SQLAlchemy 1.3.23 Postgres…
Ubaidul Khan
  • 131
  • 3
  • 13
0
votes
1 answer

ERROR: role cannot be dropped because some objects depend on it

I'm trying to drop a role but getting this: ERROR: role "xyz" cannot be dropped because some objects depend on it It shows which objects are, they are tables on different schemas on different DBs on the server. Is there an easy way to remove the…
Matias
  • 539
  • 5
  • 28
0
votes
2 answers

How to drop rows with conditions in R

I have encountered a problem when I try to clean up a data frame in R, and I have been unable to find the answer anywhere. I have a data frame that looks like this: df <- data.frame(ID = c(1,1,1,1,2,2,2,2,3,3,3), A =…
0
votes
1 answer

Drag and drop image in Wxpython

I have created 3 panels in wxpython. One at top. And other 2 panels at bottom in vertical fashion. Panel2 consists of ListControl as list1 and Panel3 consist of ListControl as list2. I have used wx.ImageList in conjunction with wx.ListCtrl in panel2…
Bhagya
  • 31
  • 5
0
votes
3 answers

How to drop duplicates in pandas dataframe but keep row based on specific column value

I have a pandas dataframe with NBA player stats, and I want to drop the rows of duplicate players. There are duplicates because some players played on multiple teams for the 2020-2021 season, and I want to drop these duplicates. However, for these…
PaulSG
  • 1
  • 1
  • 1
0
votes
1 answer

Javascript Draggable

I am trying to make a page where the user can drag and drop images anywhere on the screen: In my HTML file, the images have class = "draggable". I am not able to get the images to move to where it is dragged to. Below is my javascript code: const…
0
votes
1 answer

Drop columns tha thave a header but all rows are empty Python 3 & Pandas

I just could not figure this one out: df.dropna(axis = 1, how="all").dropna(axis= 0 ,how="all") All headers have data. How can I exclude the headers form a df.dropna(how="all") command. I am afraid this is going to be trivial, but help me out…
Levente
  • 1
  • 1
0
votes
1 answer

Why my csv file is larger after dropping duplicates with Python Pandas dataframe

I wrote this code to get rid of the duplicates in a large (800000) tweets csv file but, when I run it, the file I get is larger than the original one: Original is 1,580,307 KB and the resulting file is 1,852,462 KB. I've tried with a smaller one of…
Sofia
  • 11
  • 3
0
votes
2 answers

Drop NaN's from row that totals one column

I have looked high and low and tried so many different codes from this site to help me with my problem. Maybe someone can make a suggestion? I have a dataframe that looks like this: I hope that table came out right. I'm a newbie to Stack Overflow…
KMW
  • 37
  • 1
  • 6
0
votes
2 answers

remove some rows from data after doing groupy

I have this dataset: df = pd.DataFrame({'scientist':["Wendelaar Bonga"," Sjoerd E.", "Grätzel"," Michael", "Willett", "Walter C.", "Kessler", "Ronald C.", "Witten, Edward", "Wang, Zhong Lin"], 'SubjectField':…
nemo92world
  • 101
  • 8
0
votes
0 answers

No response of my Window (WPF) after Drag and Drop to WEB page in extern browser process

In my WPF application, a small window is called up and displayed modally, from which the user (using drag and drop) must drag two strings onto a WEP page, which is displayed in a separate browser process. This also works very well as long as the…
0
votes
1 answer

Identify and delete observations that do not meet conditions in Stata

I need help identifying and removing observations that meet certain conditions. My data looks like this: ID caseID set Var1 Var2 1 1 1 1 0 1 2 1 2 0 1 3 1 3 1 1 4 2 1 0 1 5 …
Student
  • 73
  • 8
0
votes
2 answers

delete rows in a dataframe untill it finds a certain value with python

So I need this little piece of code to keep dropping rows until the A1 cell is a specific string, I tried this: while table[0][0] != 'Nº TAD': table = table.drop(table.index[0]) but it seems the loop keeps going for more than I want and I have…
Fabricio_A
  • 58
  • 7
0
votes
2 answers

Compare columns in two dataframe

I have two dataframes, df2012 and df2013, in each dataframe I have 2 columns the ID and Total, I need to compare the ID column for both dataframe and if the ID are equal, I need to compare the value of Total: know if the ratio of…
0
votes
2 answers

How to drop only 20 rows out od 35000 that contain NaN in 4 different columns?

I need help. I am trying to clean a very large data frame using pandas.I have 35064 rows and 16 columns.In 20 rows I have np.nan in 4 columns,so I want do delete these 20 rows. I wanted to replace np.nan with 0,and after that to find indexes in each…
Ana
  • 15
  • 2