The function which describe number of points per variable

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I have got a list of points:data = 1,2,1,3,1,4,2,1,2,3,2,5,2,6,2,7.
And I wanted to plot a function which will be showing the number of points for a variable, i. e. 1,2,1,3,1,4, three points so for x=1 function is 3, for x=2 function is 5.










share|improve this question







New contributor




Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    3
    down vote

    favorite












    I have got a list of points:data = 1,2,1,3,1,4,2,1,2,3,2,5,2,6,2,7.
    And I wanted to plot a function which will be showing the number of points for a variable, i. e. 1,2,1,3,1,4, three points so for x=1 function is 3, for x=2 function is 5.










    share|improve this question







    New contributor




    Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have got a list of points:data = 1,2,1,3,1,4,2,1,2,3,2,5,2,6,2,7.
      And I wanted to plot a function which will be showing the number of points for a variable, i. e. 1,2,1,3,1,4, three points so for x=1 function is 3, for x=2 function is 5.










      share|improve this question







      New contributor




      Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have got a list of points:data = 1,2,1,3,1,4,2,1,2,3,2,5,2,6,2,7.
      And I wanted to plot a function which will be showing the number of points for a variable, i. e. 1,2,1,3,1,4, three points so for x=1 function is 3, for x=2 function is 5.







      plotting list-manipulation probability-or-statistics






      share|improve this question







      New contributor




      Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 hours ago









      Marianna Kalwat

      182




      182




      New contributor




      Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Marianna Kalwat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          here you are Marianna



          F[x_] := Length@Select[data, #[[1]] == x &]
          F[1]
          F[2]



          3

          5




          as an example,
          if you have this data




          1, 9, 2, 3, 2, 10, 3, 1, 3, 2, 3, 8, 4, 5, 5, 1, 6,
          1, 6, 5, 7, 7, 8, 4, 8, 5, 8, 9, 8, 10, 9, 5, 9,
          6, 10, 2, 10, 8, 10, 10




          here is how you can plot F function



          ListPlot[Table[F[k], k, 10]]


          enter image description here






          share|improve this answer






















          • Thank you very much for help ;)
            – Marianna Kalwat
            10 mins ago










          • anytime ;) Thank you
            – J42161217
            7 mins ago

















          up vote
          1
          down vote













          f = CountsBy[data, First]



          <|1 -> 3, 2 -> 5|>




          You can do this for getting a plot:



          data = RandomInteger[1, 100, 400, 2];
          f = CountsBy[data, First];
          ListLinePlot[Lookup[f, Range[1, 100], 0], PlotRange -> All]


          enter image description here






          share|improve this answer




















            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',
            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
            );



            );






            Marianna Kalwat is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185203%2fthe-function-which-describe-number-of-points-per-variable%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            here you are Marianna



            F[x_] := Length@Select[data, #[[1]] == x &]
            F[1]
            F[2]



            3

            5




            as an example,
            if you have this data




            1, 9, 2, 3, 2, 10, 3, 1, 3, 2, 3, 8, 4, 5, 5, 1, 6,
            1, 6, 5, 7, 7, 8, 4, 8, 5, 8, 9, 8, 10, 9, 5, 9,
            6, 10, 2, 10, 8, 10, 10




            here is how you can plot F function



            ListPlot[Table[F[k], k, 10]]


            enter image description here






            share|improve this answer






















            • Thank you very much for help ;)
              – Marianna Kalwat
              10 mins ago










            • anytime ;) Thank you
              – J42161217
              7 mins ago














            up vote
            1
            down vote



            accepted










            here you are Marianna



            F[x_] := Length@Select[data, #[[1]] == x &]
            F[1]
            F[2]



            3

            5




            as an example,
            if you have this data




            1, 9, 2, 3, 2, 10, 3, 1, 3, 2, 3, 8, 4, 5, 5, 1, 6,
            1, 6, 5, 7, 7, 8, 4, 8, 5, 8, 9, 8, 10, 9, 5, 9,
            6, 10, 2, 10, 8, 10, 10




            here is how you can plot F function



            ListPlot[Table[F[k], k, 10]]


            enter image description here






            share|improve this answer






















            • Thank you very much for help ;)
              – Marianna Kalwat
              10 mins ago










            • anytime ;) Thank you
              – J42161217
              7 mins ago












            up vote
            1
            down vote



            accepted







            up vote
            1
            down vote



            accepted






            here you are Marianna



            F[x_] := Length@Select[data, #[[1]] == x &]
            F[1]
            F[2]



            3

            5




            as an example,
            if you have this data




            1, 9, 2, 3, 2, 10, 3, 1, 3, 2, 3, 8, 4, 5, 5, 1, 6,
            1, 6, 5, 7, 7, 8, 4, 8, 5, 8, 9, 8, 10, 9, 5, 9,
            6, 10, 2, 10, 8, 10, 10




            here is how you can plot F function



            ListPlot[Table[F[k], k, 10]]


            enter image description here






            share|improve this answer














            here you are Marianna



            F[x_] := Length@Select[data, #[[1]] == x &]
            F[1]
            F[2]



            3

            5




            as an example,
            if you have this data




            1, 9, 2, 3, 2, 10, 3, 1, 3, 2, 3, 8, 4, 5, 5, 1, 6,
            1, 6, 5, 7, 7, 8, 4, 8, 5, 8, 9, 8, 10, 9, 5, 9,
            6, 10, 2, 10, 8, 10, 10




            here is how you can plot F function



            ListPlot[Table[F[k], k, 10]]


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 2 hours ago

























            answered 2 hours ago









            J42161217

            2,324218




            2,324218











            • Thank you very much for help ;)
              – Marianna Kalwat
              10 mins ago










            • anytime ;) Thank you
              – J42161217
              7 mins ago
















            • Thank you very much for help ;)
              – Marianna Kalwat
              10 mins ago










            • anytime ;) Thank you
              – J42161217
              7 mins ago















            Thank you very much for help ;)
            – Marianna Kalwat
            10 mins ago




            Thank you very much for help ;)
            – Marianna Kalwat
            10 mins ago












            anytime ;) Thank you
            – J42161217
            7 mins ago




            anytime ;) Thank you
            – J42161217
            7 mins ago










            up vote
            1
            down vote













            f = CountsBy[data, First]



            <|1 -> 3, 2 -> 5|>




            You can do this for getting a plot:



            data = RandomInteger[1, 100, 400, 2];
            f = CountsBy[data, First];
            ListLinePlot[Lookup[f, Range[1, 100], 0], PlotRange -> All]


            enter image description here






            share|improve this answer
























              up vote
              1
              down vote













              f = CountsBy[data, First]



              <|1 -> 3, 2 -> 5|>




              You can do this for getting a plot:



              data = RandomInteger[1, 100, 400, 2];
              f = CountsBy[data, First];
              ListLinePlot[Lookup[f, Range[1, 100], 0], PlotRange -> All]


              enter image description here






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                f = CountsBy[data, First]



                <|1 -> 3, 2 -> 5|>




                You can do this for getting a plot:



                data = RandomInteger[1, 100, 400, 2];
                f = CountsBy[data, First];
                ListLinePlot[Lookup[f, Range[1, 100], 0], PlotRange -> All]


                enter image description here






                share|improve this answer












                f = CountsBy[data, First]



                <|1 -> 3, 2 -> 5|>




                You can do this for getting a plot:



                data = RandomInteger[1, 100, 400, 2];
                f = CountsBy[data, First];
                ListLinePlot[Lookup[f, Range[1, 100], 0], PlotRange -> All]


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 hours ago









                Henrik Schumacher

                43.6k263128




                43.6k263128




















                    Marianna Kalwat is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    Marianna Kalwat is a new contributor. Be nice, and check out our Code of Conduct.












                    Marianna Kalwat is a new contributor. Be nice, and check out our Code of Conduct.











                    Marianna Kalwat is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185203%2fthe-function-which-describe-number-of-points-per-variable%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?