Remove row from dataframe by index

715 views
Skip to first unread message

Jason Solack

unread,
Mar 1, 2014, 8:10:00 PM3/1/14
to julia...@googlegroups.com
First let me say thank you to those who have answered the series of questions i've been posting!!

I think this is my last roadblock (for now...)

how would i remove a row from a dataframe if i know the index that i'd like to drop?

Thank you again!

Jason

John Myles White

unread,
Mar 1, 2014, 8:12:53 PM3/1/14
to julia...@googlegroups.com
I’m not sure if we have a convenient way to do that right now.

The best thing I can come up with is:

df = DataFrame(A = 1:10)
inds = df[:A] .!= 3
df = df[inds, :]

We should add a delete! (or splice!) method for this.

— John

Jason Solack

unread,
Mar 1, 2014, 9:08:20 PM3/1/14
to julia...@googlegroups.com
thank you!

Yes, that would be nice... in my case i'm removing the minimum value found in a particular column and it's easy to find the index of that... so some sort of delete would be convenient, but your technique is working well!
Reply all
Reply to author
Forward
0 new messages