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

  • SEARCH
  • Home
  • 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 8249389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:31:40+00:00 2026-06-07T23:31:40+00:00

I have a 721 x 26 dataframe. Some rows have entries that are blank.

  • 0

I have a 721 x 26 dataframe. Some rows have entries that are blank. It’s not NULL
or NA but just empty like the following. How can I delete those rows that have these kind of entries?

1         Y    N        Y          N            86.8
2         N    N        Y          N            50.0
3                                               76.8
4         N    N        Y          N            46.6
5         Y    Y        Y          Y            30.0
  • 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-06-07T23:31:41+00:00Added an answer on June 7, 2026 at 11:31 pm

    The answer to this question depends on how paranoid you want to be about the sort of things that might be in ‘blank’-appearing character strings. Here’s a fairly careful approach that will match the zero-length blank string "" as well as any string composed of one or more [[:space:]] characters (i.e. “tab, newline, vertical tab, form feed, carriage return, space and possibly other locale-dependent characters”, according to the ?regex help page).

    ## An example data.frame containing all sorts of 'blank' strings
    df <- data.frame(A = c("a", "", "\n", " ", " \t\t", "b"),
                     B = c("b", "b", "\t", " ", "\t\t\t", "d"),
                     C = 1:6)
    
    ## Test each element to see if is either zero-length or contains just
    ## space characters
    pat <- "^[[:space:]]*$"
    subdf <- df[-which(names(df) %in% "C")] # removes columns not involved in the test
    matches <- data.frame(lapply(subdf, function(x) grepl(pat, x))) 
    
    ## Subset df to remove rows fully composed of elements matching `pat` 
    df[!apply(matches, 1, all),]
    #   A B C
    # 1 a b 1
    # 2   b 2
    # 6 b d 6
    
    ## OR, to remove rows with *any* blank entries
    df[!apply(matches, 1, any),]
    #   A B C
    # 1 a b 1
    # 6 b d 6
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file of 12Mb approximately that has the following typology [[1,-154],[2,-100],[3,-28],[4,-66],[5,-222],[6,-309],[7,-196],[8,-50],[9,-53],[10,-209],[11,-355],[12,-350],[13,-269],[14,-264],[15,-392],[16,-513],[17,-515],[18,-434],[19,-418],[20,-505],[21,-592],[22,-559],[23,-422],[24,-384],[25,-539],[26,-716],[27,-713],[28,-593],[29,-534],[30,-647],[31,-813],[32,-857],[33,-711],[34,-582],[35,-594],[36,-700],[37,-721],[38,-600],[39,-487],[40,-490],[41,-589],[42,-630],[43,-502],[44,-365],[45,-340],[46,-403],[47,-420],[48,-291],[49,-136],[50,-98],[51,-218],[52,-285],[53,-198],[54,-52],[55,-58],[56,-213],[57,-334],[58,-301],[59,-195],[60,-195],[61,-324],[62,-470],[63,-465],[64,-378],[65,-381],[66,-546],[67,-734],[68,-767],[69,-695],[70,-683],[71,-804],[72,-991],[73,-1050],[74,-937],[75,-850],[76,-912],[77,-1041],[78,-1065],[79,-972],[80,-931],[81,-1030],[82,-1186],[83,-1233],[84,-1113],[85,-992],[86,-1051],[87,-1206],[88,-1299],[89,-1218],[90,-1112],[91,-1150],[92,-1287],[93,-1345],[94,-1239],[95,-1140],[96,-1147],[97,-1276],[98,-1363],[99,-1312],[100,-1206],[101,-1184],[102,-1297],[103,-1378],[104,-1297],[105,-1141],[106,-1113],[107,-1219],[108,-1325],[109,-1284],[110,-1147],[111,-1103],[112,-1179],[113,-1300],[114,-1262],[115,-1141], I'd
I have a large array with 1024 entries that have 7 bit values in
have a small javscript that users can include into their sites like so: <script
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
i have an nhibernate solution and i'm trying to do a save, but i'm
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Let's say I have some data, either in a SQL Server 2008 table or
i'm pretty new to flex 3 but it's really cool so far. i have
I have a web application, and I have a label that is pulling a
Could you please help me with such converting I have NSString date like @2/8/2012

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.