Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6127759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:32:55+00:00 2026-05-23T16:32:55+00:00

I do I remove all rows in a dataframe where a certain row meets

  • 0

I do I remove all rows in a dataframe where a certain row meets a string match criteria?

For example:

A,B,C
4,3,Foo
2,3,Bar
7,5,Zap

How would I return a dataframe that excludes all rows where C = Foo:

A,B,C
2,3,Bar
7,5,Zap
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:32:56+00:00Added an answer on May 23, 2026 at 4:32 pm

    Just use the == with the negation symbol (!). If dtfm is the name of your data.frame:

    dtfm[!dtfm$C == "Foo", ]
    

    Or, to move the negation in the comparison:

    dtfm[dtfm$C != "Foo", ]
    

    Or, even shorter using subset():

    subset(dtfm, C!="Foo")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to remove all the rows from a dataframe named mydata where
I want to remove all rows apart from the row with id 'row0' from
I have a dataframe m and I want to remove all the rows where
How can one remove all text, but leave the structure intact? for example: <animals>
I want to remove all special characters from a string. Allowed characters are A-Z
I want to remove all rows that i entered from my SQLite database table.
Is there an Awk or Perl one-liner that can remove all rows that do
How to find all rows of a table where attribute [data-order] is undefined? this.tbl_list[0].rows.find('[data-order=undefined]').remove();
I am trying to remove all the rows to reload them (I need to
Can anyone tell me that how to remove all rows of a tableView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.