How to explain the strange behaviour about Function Nothing [duplicate]Using Sequence to delete a part of an expressionBuilding a list recursive with one or more argumentsreplace two elements in a list with the sum of those two elements?Comparing elements of a set and deleting elements based on a criterionJoin nested lists based on first and last elements within each listEfficient way to get elements in listDelete elements less than the last largest element

Can two moons have intersecting orbits yet be guaranteed not to collide?

How to create "wave"-like type in Illustrator

Why do cargo airplanes fly fewer cycles then airliners?

Prospective employer asking for my current pay slip during interview

US 24 hour cancellation right: can you roll it over multiple days?

Should I still follow "programming to an interface not implementation" even if I think using concrete class members is the simpler solution?

What are the factors that decide on whether you die instantly or get knocked out in PUBG?

Can the Detect Magic spell detect an Antimagic Field spell?

Prefix all commands in shell

How to build an overfitted network in order to increase performances

Why does std::atomic constructor behave different in C++14 and C++17

Can I re-whip whipped cream?

Intersection of sorted lists

Next Shared Totient

Is a triangle waveform a type of pulse width modulation?

What is homebrew? Should I use it in normal games?

How could pirates reasonably transport dinosaurs in captivity, some of them enormous, across oceans?

In Germany, why does the burden of proof fall on authorities rather than the company or individual when it comes to possible illegal funds?

Are soldered electrical connections code-compliant?

Intuitive explanation why some autonomous DEs go to infinity in finite time.

Mostly One Way Travel : Says Grandpa

Was playing with both hands ever allowed in chess?

How to tell my Mom that I don't care about someone without upsetting her?

A single word for "not allowed to be changed" or "must be this way"



How to explain the strange behaviour about Function Nothing [duplicate]


Using Sequence to delete a part of an expressionBuilding a list recursive with one or more argumentsreplace two elements in a list with the sum of those two elements?Comparing elements of a set and deleting elements based on a criterionJoin nested lists based on first and last elements within each listEfficient way to get elements in listDelete elements less than the last largest element






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;

.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;








8















$begingroup$


There are some things wrong when i try to delete an element of a list by using function Nothing.
Here is a simple example:



a = Range[10], a[[1]], a[[1]] = Nothing, a(*1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10*)


It works,but when i try it again.



a[[1]], a[[1]] = Nothing, a(*2,2,3,4,5,6,7,8,9,10*)


It doesn't work.Finally i found that the first element of a could be deleted if i evaluate the code a[[2]]=Nothing,Any answer will be most appreciated










share|improve this question











$endgroup$














  • $begingroup$
    Please do not use the Bugs tag for new questions - see the tags description for why
    $endgroup$
    – Lukas Lang
    Sep 27 at 12:00










  • $begingroup$
    Thank you for the hint!@Lukas Lang
    $endgroup$
    – 任天一
    Sep 27 at 12:16










  • $begingroup$
    Note: while this one is about Nothing rather than Sequence, the two are very similar, and the mechanism that is what puzzles the OP, is exactly the same. In this sense, this is still a duplicate, thus voting to close (apparently, I even mentioned Nothing in my answer there).
    $endgroup$
    – Leonid Shifrin
    Sep 27 at 23:20











  • $begingroup$
    @LeonidShifrin Your answer is woefully ncomplete. A proper discussion of Nothing will never omit this
    $endgroup$
    – Daniel Lichtblau
    Nov 24 at 16:16










  • $begingroup$
    @DanielLichtblau You are totally right. In fact, that link of yours is the answer, should be posted / accepted instead.
    $endgroup$
    – Leonid Shifrin
    Nov 24 at 18:33

















8















$begingroup$


There are some things wrong when i try to delete an element of a list by using function Nothing.
Here is a simple example:



a = Range[10], a[[1]], a[[1]] = Nothing, a(*1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10*)


It works,but when i try it again.



a[[1]], a[[1]] = Nothing, a(*2,2,3,4,5,6,7,8,9,10*)


It doesn't work.Finally i found that the first element of a could be deleted if i evaluate the code a[[2]]=Nothing,Any answer will be most appreciated










share|improve this question











$endgroup$














  • $begingroup$
    Please do not use the Bugs tag for new questions - see the tags description for why
    $endgroup$
    – Lukas Lang
    Sep 27 at 12:00










  • $begingroup$
    Thank you for the hint!@Lukas Lang
    $endgroup$
    – 任天一
    Sep 27 at 12:16










  • $begingroup$
    Note: while this one is about Nothing rather than Sequence, the two are very similar, and the mechanism that is what puzzles the OP, is exactly the same. In this sense, this is still a duplicate, thus voting to close (apparently, I even mentioned Nothing in my answer there).
    $endgroup$
    – Leonid Shifrin
    Sep 27 at 23:20











  • $begingroup$
    @LeonidShifrin Your answer is woefully ncomplete. A proper discussion of Nothing will never omit this
    $endgroup$
    – Daniel Lichtblau
    Nov 24 at 16:16










  • $begingroup$
    @DanielLichtblau You are totally right. In fact, that link of yours is the answer, should be posted / accepted instead.
    $endgroup$
    – Leonid Shifrin
    Nov 24 at 18:33













8













8









8


1



$begingroup$


There are some things wrong when i try to delete an element of a list by using function Nothing.
Here is a simple example:



a = Range[10], a[[1]], a[[1]] = Nothing, a(*1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10*)


It works,but when i try it again.



a[[1]], a[[1]] = Nothing, a(*2,2,3,4,5,6,7,8,9,10*)


It doesn't work.Finally i found that the first element of a could be deleted if i evaluate the code a[[2]]=Nothing,Any answer will be most appreciated










share|improve this question











$endgroup$




There are some things wrong when i try to delete an element of a list by using function Nothing.
Here is a simple example:



a = Range[10], a[[1]], a[[1]] = Nothing, a(*1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10*)


It works,but when i try it again.



a[[1]], a[[1]] = Nothing, a(*2,2,3,4,5,6,7,8,9,10*)


It doesn't work.Finally i found that the first element of a could be deleted if i evaluate the code a[[2]]=Nothing,Any answer will be most appreciated








This question already has answers here:





Using Sequence to delete a part of an expression

(2 answers)


Closed 2 months ago.






This question already has answers here:







This question already has answers here:





This question already has answers here:




Using Sequence to delete a part of an expression

(2 answers)



Closed 2 months ago.





list-manipulation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 27 at 12:00









Lukas Lang

13.1k1 gold badge14 silver badges45 bronze badges




13.1k1 gold badge14 silver badges45 bronze badges










asked Sep 27 at 11:43









任天一任天一

3741 silver badge9 bronze badges




3741 silver badge9 bronze badges














  • $begingroup$
    Please do not use the Bugs tag for new questions - see the tags description for why
    $endgroup$
    – Lukas Lang
    Sep 27 at 12:00










  • $begingroup$
    Thank you for the hint!@Lukas Lang
    $endgroup$
    – 任天一
    Sep 27 at 12:16










  • $begingroup$
    Note: while this one is about Nothing rather than Sequence, the two are very similar, and the mechanism that is what puzzles the OP, is exactly the same. In this sense, this is still a duplicate, thus voting to close (apparently, I even mentioned Nothing in my answer there).
    $endgroup$
    – Leonid Shifrin
    Sep 27 at 23:20











  • $begingroup$
    @LeonidShifrin Your answer is woefully ncomplete. A proper discussion of Nothing will never omit this
    $endgroup$
    – Daniel Lichtblau
    Nov 24 at 16:16










  • $begingroup$
    @DanielLichtblau You are totally right. In fact, that link of yours is the answer, should be posted / accepted instead.
    $endgroup$
    – Leonid Shifrin
    Nov 24 at 18:33
















  • $begingroup$
    Please do not use the Bugs tag for new questions - see the tags description for why
    $endgroup$
    – Lukas Lang
    Sep 27 at 12:00










  • $begingroup$
    Thank you for the hint!@Lukas Lang
    $endgroup$
    – 任天一
    Sep 27 at 12:16










  • $begingroup$
    Note: while this one is about Nothing rather than Sequence, the two are very similar, and the mechanism that is what puzzles the OP, is exactly the same. In this sense, this is still a duplicate, thus voting to close (apparently, I even mentioned Nothing in my answer there).
    $endgroup$
    – Leonid Shifrin
    Sep 27 at 23:20











  • $begingroup$
    @LeonidShifrin Your answer is woefully ncomplete. A proper discussion of Nothing will never omit this
    $endgroup$
    – Daniel Lichtblau
    Nov 24 at 16:16










  • $begingroup$
    @DanielLichtblau You are totally right. In fact, that link of yours is the answer, should be posted / accepted instead.
    $endgroup$
    – Leonid Shifrin
    Nov 24 at 18:33















$begingroup$
Please do not use the Bugs tag for new questions - see the tags description for why
$endgroup$
– Lukas Lang
Sep 27 at 12:00




$begingroup$
Please do not use the Bugs tag for new questions - see the tags description for why
$endgroup$
– Lukas Lang
Sep 27 at 12:00












$begingroup$
Thank you for the hint!@Lukas Lang
$endgroup$
– 任天一
Sep 27 at 12:16




$begingroup$
Thank you for the hint!@Lukas Lang
$endgroup$
– 任天一
Sep 27 at 12:16












$begingroup$
Note: while this one is about Nothing rather than Sequence, the two are very similar, and the mechanism that is what puzzles the OP, is exactly the same. In this sense, this is still a duplicate, thus voting to close (apparently, I even mentioned Nothing in my answer there).
$endgroup$
– Leonid Shifrin
Sep 27 at 23:20





$begingroup$
Note: while this one is about Nothing rather than Sequence, the two are very similar, and the mechanism that is what puzzles the OP, is exactly the same. In this sense, this is still a duplicate, thus voting to close (apparently, I even mentioned Nothing in my answer there).
$endgroup$
– Leonid Shifrin
Sep 27 at 23:20













$begingroup$
@LeonidShifrin Your answer is woefully ncomplete. A proper discussion of Nothing will never omit this
$endgroup$
– Daniel Lichtblau
Nov 24 at 16:16




$begingroup$
@LeonidShifrin Your answer is woefully ncomplete. A proper discussion of Nothing will never omit this
$endgroup$
– Daniel Lichtblau
Nov 24 at 16:16












$begingroup$
@DanielLichtblau You are totally right. In fact, that link of yours is the answer, should be posted / accepted instead.
$endgroup$
– Leonid Shifrin
Nov 24 at 18:33




$begingroup$
@DanielLichtblau You are totally right. In fact, that link of yours is the answer, should be posted / accepted instead.
$endgroup$
– Leonid Shifrin
Nov 24 at 18:33










2 Answers
2






active

oldest

votes


















11

















$begingroup$

Part assignment performs in-place modification of an expression without evaluation of the result. At the same time, on the Documentation page for Nothing we read:




Nothing is removed as part of the standard evaluation process.




So after evaluation of a[[1]] = Nothing you still have a List of length 10 with first element being Nothing. You can replace Nothing with anything else in the same way again:



a[[1]] = Nothing;
Definition[a]
a[[1]] = Missing[];
Definition[a]



a=Nothing,2,3,4,5,6,7,8,9,10

a=Missing[],2,3,4,5,6,7,8,9,10



You can remove Nothing by evaluating the expression:



a[[1]] = Nothing;
Definition[a]
a = a;
Definition[a]



a=Nothing,2,3,4,5,6,7,8,9,10
a=2,3,4,5,6,7,8,9,10




Instead of Nothing you can use such functions as Delete, Drop, Take or ReplacePart for the same purpose.






share|improve this answer












$endgroup$





















    12

















    $begingroup$

    Taking a look at ?a shows what's going on:



    ?a

    (* Global`a *)

    (* a=Nothing,2,3,4,5,6,7,8,9,10 *)


    It seems that Part ([[...]]) does not apply the effect of Nothing after the replacement has been done, leaving you with a list that is still 10 elements long. So the second a[[1]]=... simply replaces the Nothing in the first element with Nothing again.



    You case use Delete to do the deletion properly:



    a = Range[10], a[[1]], a = Delete[a, 1], a
    (* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9,
    10, 2, 3, 4, 5, 6, 7, 8, 9, 10 *)

    a[[1]], a = Delete[a, 1], a
    (* 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10 *)





    share|improve this answer










    $endgroup$













    • $begingroup$
      Thank you for the answer!i get it.
      $endgroup$
      – 任天一
      Sep 27 at 12:20










    • $begingroup$
      Interesting that a, b, Nothing, c, d, Nothing; (* new line *) % // Length gives 4.
      $endgroup$
      – Markhaim
      Sep 27 at 12:24







    • 4




      $begingroup$
      @Markhaim That happens because the list gets evaluated and after evaluation the Nothings will have disappeared. If you compare Length[Unevaluated[1, Nothing, 3]] with Length[1, Nothing, 3], you'll see the same effect.
      $endgroup$
      – Sjoerd Smit
      Sep 27 at 14:25


















    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    11

















    $begingroup$

    Part assignment performs in-place modification of an expression without evaluation of the result. At the same time, on the Documentation page for Nothing we read:




    Nothing is removed as part of the standard evaluation process.




    So after evaluation of a[[1]] = Nothing you still have a List of length 10 with first element being Nothing. You can replace Nothing with anything else in the same way again:



    a[[1]] = Nothing;
    Definition[a]
    a[[1]] = Missing[];
    Definition[a]



    a=Nothing,2,3,4,5,6,7,8,9,10

    a=Missing[],2,3,4,5,6,7,8,9,10



    You can remove Nothing by evaluating the expression:



    a[[1]] = Nothing;
    Definition[a]
    a = a;
    Definition[a]



    a=Nothing,2,3,4,5,6,7,8,9,10
    a=2,3,4,5,6,7,8,9,10




    Instead of Nothing you can use such functions as Delete, Drop, Take or ReplacePart for the same purpose.






    share|improve this answer












    $endgroup$


















      11

















      $begingroup$

      Part assignment performs in-place modification of an expression without evaluation of the result. At the same time, on the Documentation page for Nothing we read:




      Nothing is removed as part of the standard evaluation process.




      So after evaluation of a[[1]] = Nothing you still have a List of length 10 with first element being Nothing. You can replace Nothing with anything else in the same way again:



      a[[1]] = Nothing;
      Definition[a]
      a[[1]] = Missing[];
      Definition[a]



      a=Nothing,2,3,4,5,6,7,8,9,10

      a=Missing[],2,3,4,5,6,7,8,9,10



      You can remove Nothing by evaluating the expression:



      a[[1]] = Nothing;
      Definition[a]
      a = a;
      Definition[a]



      a=Nothing,2,3,4,5,6,7,8,9,10
      a=2,3,4,5,6,7,8,9,10




      Instead of Nothing you can use such functions as Delete, Drop, Take or ReplacePart for the same purpose.






      share|improve this answer












      $endgroup$
















        11















        11











        11







        $begingroup$

        Part assignment performs in-place modification of an expression without evaluation of the result. At the same time, on the Documentation page for Nothing we read:




        Nothing is removed as part of the standard evaluation process.




        So after evaluation of a[[1]] = Nothing you still have a List of length 10 with first element being Nothing. You can replace Nothing with anything else in the same way again:



        a[[1]] = Nothing;
        Definition[a]
        a[[1]] = Missing[];
        Definition[a]



        a=Nothing,2,3,4,5,6,7,8,9,10

        a=Missing[],2,3,4,5,6,7,8,9,10



        You can remove Nothing by evaluating the expression:



        a[[1]] = Nothing;
        Definition[a]
        a = a;
        Definition[a]



        a=Nothing,2,3,4,5,6,7,8,9,10
        a=2,3,4,5,6,7,8,9,10




        Instead of Nothing you can use such functions as Delete, Drop, Take or ReplacePart for the same purpose.






        share|improve this answer












        $endgroup$



        Part assignment performs in-place modification of an expression without evaluation of the result. At the same time, on the Documentation page for Nothing we read:




        Nothing is removed as part of the standard evaluation process.




        So after evaluation of a[[1]] = Nothing you still have a List of length 10 with first element being Nothing. You can replace Nothing with anything else in the same way again:



        a[[1]] = Nothing;
        Definition[a]
        a[[1]] = Missing[];
        Definition[a]



        a=Nothing,2,3,4,5,6,7,8,9,10

        a=Missing[],2,3,4,5,6,7,8,9,10



        You can remove Nothing by evaluating the expression:



        a[[1]] = Nothing;
        Definition[a]
        a = a;
        Definition[a]



        a=Nothing,2,3,4,5,6,7,8,9,10
        a=2,3,4,5,6,7,8,9,10




        Instead of Nothing you can use such functions as Delete, Drop, Take or ReplacePart for the same purpose.







        share|improve this answer















        share|improve this answer




        share|improve this answer








        edited Nov 23 at 7:24

























        answered Sep 27 at 13:53









        Alexey PopkovAlexey Popkov

        48.1k4 gold badges118 silver badges282 bronze badges




        48.1k4 gold badges118 silver badges282 bronze badges


























            12

















            $begingroup$

            Taking a look at ?a shows what's going on:



            ?a

            (* Global`a *)

            (* a=Nothing,2,3,4,5,6,7,8,9,10 *)


            It seems that Part ([[...]]) does not apply the effect of Nothing after the replacement has been done, leaving you with a list that is still 10 elements long. So the second a[[1]]=... simply replaces the Nothing in the first element with Nothing again.



            You case use Delete to do the deletion properly:



            a = Range[10], a[[1]], a = Delete[a, 1], a
            (* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9,
            10, 2, 3, 4, 5, 6, 7, 8, 9, 10 *)

            a[[1]], a = Delete[a, 1], a
            (* 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10 *)





            share|improve this answer










            $endgroup$













            • $begingroup$
              Thank you for the answer!i get it.
              $endgroup$
              – 任天一
              Sep 27 at 12:20










            • $begingroup$
              Interesting that a, b, Nothing, c, d, Nothing; (* new line *) % // Length gives 4.
              $endgroup$
              – Markhaim
              Sep 27 at 12:24







            • 4




              $begingroup$
              @Markhaim That happens because the list gets evaluated and after evaluation the Nothings will have disappeared. If you compare Length[Unevaluated[1, Nothing, 3]] with Length[1, Nothing, 3], you'll see the same effect.
              $endgroup$
              – Sjoerd Smit
              Sep 27 at 14:25















            12

















            $begingroup$

            Taking a look at ?a shows what's going on:



            ?a

            (* Global`a *)

            (* a=Nothing,2,3,4,5,6,7,8,9,10 *)


            It seems that Part ([[...]]) does not apply the effect of Nothing after the replacement has been done, leaving you with a list that is still 10 elements long. So the second a[[1]]=... simply replaces the Nothing in the first element with Nothing again.



            You case use Delete to do the deletion properly:



            a = Range[10], a[[1]], a = Delete[a, 1], a
            (* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9,
            10, 2, 3, 4, 5, 6, 7, 8, 9, 10 *)

            a[[1]], a = Delete[a, 1], a
            (* 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10 *)





            share|improve this answer










            $endgroup$













            • $begingroup$
              Thank you for the answer!i get it.
              $endgroup$
              – 任天一
              Sep 27 at 12:20










            • $begingroup$
              Interesting that a, b, Nothing, c, d, Nothing; (* new line *) % // Length gives 4.
              $endgroup$
              – Markhaim
              Sep 27 at 12:24







            • 4




              $begingroup$
              @Markhaim That happens because the list gets evaluated and after evaluation the Nothings will have disappeared. If you compare Length[Unevaluated[1, Nothing, 3]] with Length[1, Nothing, 3], you'll see the same effect.
              $endgroup$
              – Sjoerd Smit
              Sep 27 at 14:25













            12















            12











            12







            $begingroup$

            Taking a look at ?a shows what's going on:



            ?a

            (* Global`a *)

            (* a=Nothing,2,3,4,5,6,7,8,9,10 *)


            It seems that Part ([[...]]) does not apply the effect of Nothing after the replacement has been done, leaving you with a list that is still 10 elements long. So the second a[[1]]=... simply replaces the Nothing in the first element with Nothing again.



            You case use Delete to do the deletion properly:



            a = Range[10], a[[1]], a = Delete[a, 1], a
            (* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9,
            10, 2, 3, 4, 5, 6, 7, 8, 9, 10 *)

            a[[1]], a = Delete[a, 1], a
            (* 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10 *)





            share|improve this answer










            $endgroup$



            Taking a look at ?a shows what's going on:



            ?a

            (* Global`a *)

            (* a=Nothing,2,3,4,5,6,7,8,9,10 *)


            It seems that Part ([[...]]) does not apply the effect of Nothing after the replacement has been done, leaving you with a list that is still 10 elements long. So the second a[[1]]=... simply replaces the Nothing in the first element with Nothing again.



            You case use Delete to do the deletion properly:



            a = Range[10], a[[1]], a = Delete[a, 1], a
            (* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9,
            10, 2, 3, 4, 5, 6, 7, 8, 9, 10 *)

            a[[1]], a = Delete[a, 1], a
            (* 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10 *)






            share|improve this answer













            share|improve this answer




            share|improve this answer










            answered Sep 27 at 12:00









            Lukas LangLukas Lang

            13.1k1 gold badge14 silver badges45 bronze badges




            13.1k1 gold badge14 silver badges45 bronze badges














            • $begingroup$
              Thank you for the answer!i get it.
              $endgroup$
              – 任天一
              Sep 27 at 12:20










            • $begingroup$
              Interesting that a, b, Nothing, c, d, Nothing; (* new line *) % // Length gives 4.
              $endgroup$
              – Markhaim
              Sep 27 at 12:24







            • 4




              $begingroup$
              @Markhaim That happens because the list gets evaluated and after evaluation the Nothings will have disappeared. If you compare Length[Unevaluated[1, Nothing, 3]] with Length[1, Nothing, 3], you'll see the same effect.
              $endgroup$
              – Sjoerd Smit
              Sep 27 at 14:25
















            • $begingroup$
              Thank you for the answer!i get it.
              $endgroup$
              – 任天一
              Sep 27 at 12:20










            • $begingroup$
              Interesting that a, b, Nothing, c, d, Nothing; (* new line *) % // Length gives 4.
              $endgroup$
              – Markhaim
              Sep 27 at 12:24







            • 4




              $begingroup$
              @Markhaim That happens because the list gets evaluated and after evaluation the Nothings will have disappeared. If you compare Length[Unevaluated[1, Nothing, 3]] with Length[1, Nothing, 3], you'll see the same effect.
              $endgroup$
              – Sjoerd Smit
              Sep 27 at 14:25















            $begingroup$
            Thank you for the answer!i get it.
            $endgroup$
            – 任天一
            Sep 27 at 12:20




            $begingroup$
            Thank you for the answer!i get it.
            $endgroup$
            – 任天一
            Sep 27 at 12:20












            $begingroup$
            Interesting that a, b, Nothing, c, d, Nothing; (* new line *) % // Length gives 4.
            $endgroup$
            – Markhaim
            Sep 27 at 12:24





            $begingroup$
            Interesting that a, b, Nothing, c, d, Nothing; (* new line *) % // Length gives 4.
            $endgroup$
            – Markhaim
            Sep 27 at 12:24





            4




            4




            $begingroup$
            @Markhaim That happens because the list gets evaluated and after evaluation the Nothings will have disappeared. If you compare Length[Unevaluated[1, Nothing, 3]] with Length[1, Nothing, 3], you'll see the same effect.
            $endgroup$
            – Sjoerd Smit
            Sep 27 at 14:25




            $begingroup$
            @Markhaim That happens because the list gets evaluated and after evaluation the Nothings will have disappeared. If you compare Length[Unevaluated[1, Nothing, 3]] with Length[1, Nothing, 3], you'll see the same effect.
            $endgroup$
            – Sjoerd Smit
            Sep 27 at 14:25



            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?