How to remove from the data the rows of with fixed number of elements?How to Import random elements of huge...

Why did the villain in the first Men in Black movie care about Earth's Cockroaches?

Why do all the books in Game of Thrones library have their covers facing the back of the shelf?

Why do we have to make "peinlich" start with a capital letter and also end with -s in this sentence?

Existence of Riemann surface, holomorphic maps

False written accusations not made public - is there law to cover this?

The effect of fishing on total land area needed to feed an island settlement

Why is Agricola named as such?

Can you tell from a blurry photo if focus was too close or too far?

Can the "Friends" spell be used without making the target hostile?

Current across a wire with zero potential difference

What senses are available to a corpse subjected to a Speak with Dead spell?

Does diversity provide anything that meritocracy does not?

Early credit roll before the end of the film

What is the wife of a henpecked husband called?

Eww, those bytes are gross

After checking in online, how do I know whether I need to go show my passport at airport check-in?

Potential client has a problematic employee I can't work with

What game did these black and yellow dice come from?

Why is it that Bernie Sanders is always called a "socialist"?

How can the probability of a fumble decrease linearly with more dice?

Bash script to truncate subject line of incoming email

How do you voice extended chords?

Is there a lava-breathing lizard creature (that could be worshipped by a cult) in 5e?

Should I always close BufferedReader?



How to remove from the data the rows of with fixed number of elements?


How to Import random elements of huge data filesImport data from first/last 100 rows of a fileHow to remove outliers from dataRemove the odd element from a listRemove noise from dataRemove rows in table that have rows with missing valuesHow to extract first 9 rows from every block of 22 rows?How to remove circled noise from imageHow do I remove particular $x$ and $y$ values from a list of data points?How to select the data in a given way?













3












$begingroup$


Consider the data which has the form



data = {{x1,y1,z1},{x2,y2,z2,t2},{x3,y4,z4,t4},{x5,y5,z5},...}


How to remove the rows containing three elements from the data?



I.e., to obtain



dataprime = {{x2,y2,z2,t2},{x3,y4,z4,t4},...}









share|improve this question











$endgroup$








  • 1




    $begingroup$
    Maybe you ask for DeleteCases[data, _?(Length[#] == 3 &)]...
    $endgroup$
    – Henrik Schumacher
    4 hours ago










  • $begingroup$
    @HenrikSchumacher : sorry, already corrected this.
    $endgroup$
    – John Taylor
    4 hours ago
















3












$begingroup$


Consider the data which has the form



data = {{x1,y1,z1},{x2,y2,z2,t2},{x3,y4,z4,t4},{x5,y5,z5},...}


How to remove the rows containing three elements from the data?



I.e., to obtain



dataprime = {{x2,y2,z2,t2},{x3,y4,z4,t4},...}









share|improve this question











$endgroup$








  • 1




    $begingroup$
    Maybe you ask for DeleteCases[data, _?(Length[#] == 3 &)]...
    $endgroup$
    – Henrik Schumacher
    4 hours ago










  • $begingroup$
    @HenrikSchumacher : sorry, already corrected this.
    $endgroup$
    – John Taylor
    4 hours ago














3












3








3





$begingroup$


Consider the data which has the form



data = {{x1,y1,z1},{x2,y2,z2,t2},{x3,y4,z4,t4},{x5,y5,z5},...}


How to remove the rows containing three elements from the data?



I.e., to obtain



dataprime = {{x2,y2,z2,t2},{x3,y4,z4,t4},...}









share|improve this question











$endgroup$




Consider the data which has the form



data = {{x1,y1,z1},{x2,y2,z2,t2},{x3,y4,z4,t4},{x5,y5,z5},...}


How to remove the rows containing three elements from the data?



I.e., to obtain



dataprime = {{x2,y2,z2,t2},{x3,y4,z4,t4},...}






data filtering






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago







John Taylor

















asked 4 hours ago









John TaylorJohn Taylor

736211




736211








  • 1




    $begingroup$
    Maybe you ask for DeleteCases[data, _?(Length[#] == 3 &)]...
    $endgroup$
    – Henrik Schumacher
    4 hours ago










  • $begingroup$
    @HenrikSchumacher : sorry, already corrected this.
    $endgroup$
    – John Taylor
    4 hours ago














  • 1




    $begingroup$
    Maybe you ask for DeleteCases[data, _?(Length[#] == 3 &)]...
    $endgroup$
    – Henrik Schumacher
    4 hours ago










  • $begingroup$
    @HenrikSchumacher : sorry, already corrected this.
    $endgroup$
    – John Taylor
    4 hours ago








1




1




$begingroup$
Maybe you ask for DeleteCases[data, _?(Length[#] == 3 &)]...
$endgroup$
– Henrik Schumacher
4 hours ago




$begingroup$
Maybe you ask for DeleteCases[data, _?(Length[#] == 3 &)]...
$endgroup$
– Henrik Schumacher
4 hours ago












$begingroup$
@HenrikSchumacher : sorry, already corrected this.
$endgroup$
– John Taylor
4 hours ago




$begingroup$
@HenrikSchumacher : sorry, already corrected this.
$endgroup$
– John Taylor
4 hours ago










2 Answers
2






active

oldest

votes


















4












$begingroup$

Any one of these would do:



Cases[data, Except[_?(Length[#] == 3 &)]]
DeleteCases[data, _?(Length[#] == 3 &)]

Select[data, Length[#] != 3 &]

Delete[data, Position[data, _?(Length[#] == 3 &)]]

data /. {_, _, _} -> Nothing
data /. {Repeated[_, {3}]} -> Nothing


They all return: {{x2, y2, z2, t2}, {x3, y4, z4, t4}}






share|improve this answer











$endgroup$





















    2












    $begingroup$

    Also



    Pick[data, Unitize[-3 + Length /@ data], 1]





    share|improve this answer









    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "387"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192243%2fhow-to-remove-from-the-data-the-rows-of-with-fixed-number-of-elements%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4












      $begingroup$

      Any one of these would do:



      Cases[data, Except[_?(Length[#] == 3 &)]]
      DeleteCases[data, _?(Length[#] == 3 &)]

      Select[data, Length[#] != 3 &]

      Delete[data, Position[data, _?(Length[#] == 3 &)]]

      data /. {_, _, _} -> Nothing
      data /. {Repeated[_, {3}]} -> Nothing


      They all return: {{x2, y2, z2, t2}, {x3, y4, z4, t4}}






      share|improve this answer











      $endgroup$


















        4












        $begingroup$

        Any one of these would do:



        Cases[data, Except[_?(Length[#] == 3 &)]]
        DeleteCases[data, _?(Length[#] == 3 &)]

        Select[data, Length[#] != 3 &]

        Delete[data, Position[data, _?(Length[#] == 3 &)]]

        data /. {_, _, _} -> Nothing
        data /. {Repeated[_, {3}]} -> Nothing


        They all return: {{x2, y2, z2, t2}, {x3, y4, z4, t4}}






        share|improve this answer











        $endgroup$
















          4












          4








          4





          $begingroup$

          Any one of these would do:



          Cases[data, Except[_?(Length[#] == 3 &)]]
          DeleteCases[data, _?(Length[#] == 3 &)]

          Select[data, Length[#] != 3 &]

          Delete[data, Position[data, _?(Length[#] == 3 &)]]

          data /. {_, _, _} -> Nothing
          data /. {Repeated[_, {3}]} -> Nothing


          They all return: {{x2, y2, z2, t2}, {x3, y4, z4, t4}}






          share|improve this answer











          $endgroup$



          Any one of these would do:



          Cases[data, Except[_?(Length[#] == 3 &)]]
          DeleteCases[data, _?(Length[#] == 3 &)]

          Select[data, Length[#] != 3 &]

          Delete[data, Position[data, _?(Length[#] == 3 &)]]

          data /. {_, _, _} -> Nothing
          data /. {Repeated[_, {3}]} -> Nothing


          They all return: {{x2, y2, z2, t2}, {x3, y4, z4, t4}}







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 hours ago

























          answered 4 hours ago









          MarcoBMarcoB

          36.3k556112




          36.3k556112























              2












              $begingroup$

              Also



              Pick[data, Unitize[-3 + Length /@ data], 1]





              share|improve this answer









              $endgroup$


















                2












                $begingroup$

                Also



                Pick[data, Unitize[-3 + Length /@ data], 1]





                share|improve this answer









                $endgroup$
















                  2












                  2








                  2





                  $begingroup$

                  Also



                  Pick[data, Unitize[-3 + Length /@ data], 1]





                  share|improve this answer









                  $endgroup$



                  Also



                  Pick[data, Unitize[-3 + Length /@ data], 1]






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 4 hours ago









                  kglrkglr

                  186k10202421




                  186k10202421






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematica Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192243%2fhow-to-remove-from-the-data-the-rows-of-with-fixed-number-of-elements%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                      How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                      夢乃愛華...