The function which describe number of points per variable
Clash 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.
plotting list-manipulation probability-or-statistics
New contributor
add a comment |Â
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.
plotting list-manipulation probability-or-statistics
New contributor
add a comment |Â
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.
plotting list-manipulation probability-or-statistics
New contributor
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
plotting list-manipulation probability-or-statistics
New contributor
New contributor
New contributor
asked 3 hours ago
Marianna Kalwat
182
182
New contributor
New contributor
add a comment |Â
add a comment |Â
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]]
Thank you very much for help ;)
â Marianna Kalwat
10 mins ago
anytime ;) Thank you
â J42161217
7 mins ago
add a comment |Â
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]
add a comment |Â
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]]
Thank you very much for help ;)
â Marianna Kalwat
10 mins ago
anytime ;) Thank you
â J42161217
7 mins ago
add a comment |Â
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]]
Thank you very much for help ;)
â Marianna Kalwat
10 mins ago
anytime ;) Thank you
â J42161217
7 mins ago
add a comment |Â
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]]
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]]
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
add a comment |Â
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
add a comment |Â
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]
add a comment |Â
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]
add a comment |Â
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]
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]
answered 2 hours ago
Henrik Schumacher
43.6k263128
43.6k263128
add a comment |Â
add a comment |Â
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.
Marianna Kalwat is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password