Count every data that grouped in list









up vote
-1
down vote

favorite












I'm trying to count total data that grouped in my list.



So here is my code:



List<InventoryViewModel> temp =
InventoriesByLocation.GroupBy(s => s.ProductId).Select(group => group.First()).ToList();


I want to count how many productId that already groupby().










share|improve this question



















  • 2




    MoreLINQ's CountBy may be worth considering - markheath.net/post/exploring-morelinq-17-countby .
    – mjwills
    Nov 11 at 20:50










  • So basically you want to count how many unique productId's there is in the list? InventoriesByLocation.Select(x => ProductId).Distinct().Count()
    – Magnus
    Nov 12 at 9:09















up vote
-1
down vote

favorite












I'm trying to count total data that grouped in my list.



So here is my code:



List<InventoryViewModel> temp =
InventoriesByLocation.GroupBy(s => s.ProductId).Select(group => group.First()).ToList();


I want to count how many productId that already groupby().










share|improve this question



















  • 2




    MoreLINQ's CountBy may be worth considering - markheath.net/post/exploring-morelinq-17-countby .
    – mjwills
    Nov 11 at 20:50










  • So basically you want to count how many unique productId's there is in the list? InventoriesByLocation.Select(x => ProductId).Distinct().Count()
    – Magnus
    Nov 12 at 9:09













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I'm trying to count total data that grouped in my list.



So here is my code:



List<InventoryViewModel> temp =
InventoriesByLocation.GroupBy(s => s.ProductId).Select(group => group.First()).ToList();


I want to count how many productId that already groupby().










share|improve this question















I'm trying to count total data that grouped in my list.



So here is my code:



List<InventoryViewModel> temp =
InventoriesByLocation.GroupBy(s => s.ProductId).Select(group => group.First()).ToList();


I want to count how many productId that already groupby().







c# list linq






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 20:52









Uwe Keim

27.3k30128210




27.3k30128210










asked Nov 11 at 20:17









Yeremia Danang

457




457







  • 2




    MoreLINQ's CountBy may be worth considering - markheath.net/post/exploring-morelinq-17-countby .
    – mjwills
    Nov 11 at 20:50










  • So basically you want to count how many unique productId's there is in the list? InventoriesByLocation.Select(x => ProductId).Distinct().Count()
    – Magnus
    Nov 12 at 9:09













  • 2




    MoreLINQ's CountBy may be worth considering - markheath.net/post/exploring-morelinq-17-countby .
    – mjwills
    Nov 11 at 20:50










  • So basically you want to count how many unique productId's there is in the list? InventoriesByLocation.Select(x => ProductId).Distinct().Count()
    – Magnus
    Nov 12 at 9:09








2




2




MoreLINQ's CountBy may be worth considering - markheath.net/post/exploring-morelinq-17-countby .
– mjwills
Nov 11 at 20:50




MoreLINQ's CountBy may be worth considering - markheath.net/post/exploring-morelinq-17-countby .
– mjwills
Nov 11 at 20:50












So basically you want to count how many unique productId's there is in the list? InventoriesByLocation.Select(x => ProductId).Distinct().Count()
– Magnus
Nov 12 at 9:09





So basically you want to count how many unique productId's there is in the list? InventoriesByLocation.Select(x => ProductId).Distinct().Count()
– Magnus
Nov 12 at 9:09













2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










So you have a sequence of InventoryViewModels, where every InventoryViewModel has a ProductId.



You want to group all InventoryViewModels into groups, where every groups contains all InventoryViewModels with the same ProductId. After that you want to count the number of InventoryViewModels in each group, and possibly also some other items. Your example code takes the first element in the group.



var groupsWithSameProductId = inventoryViewModels
.GroupBy(inventoryViewModel => inventoryViewModel.ProductId)


Now every group has a Key, which contains the ProductId that is the same for all elements in your group. The group itself is a sequence of all InventoryViewModels that have the ProductId equal to the Key.



To get the number of InventoryViewModels that have this ProductId, just Count() them. If you want other items, just Select them:



// continue the LINQ statement
.Select(group => new

ProductId = group.Key,
NrOfInventroyViewModelsWithThisProductId = group.Count(),

// only if you want other items:
FirstInventoryViewModel = group.First(),
Names = group.Select(groupItem => groupItem.Name).ToList(),
);


Note, that every groupItem is an InventoryViewModel with ProductId equal to group.Key



There is an overload of Enumerable.GroupBy that combines the grouping and selecting in one statement:



var result = inventoryViewModels
.GroupBy(inventoryViewModel => inventoryViewModel.ProductId, // make groups with same productId
(commonProductId, inventoryViewModelsWithThisCommonProductId) => new

ProductId = commonProductId,
Count = inventoryViewModelsWithThisCommonProductId.Count(),
Names = inventoryViewModelsWithThisCommonProductId
.Select(inventoryViewModelWithThisCommonProductId.Name)
.ToList(),
);





share|improve this answer




















  • thanks for your explanation and i get it. but i got Anonymous Type: a is newGuid ProductId,int NrOfInventroyViewModelsWithThisProductId and can i get the same type of list. Or the selected item cant turn into same type of list. In this case: List<inventoryfiewmodel> mInventories= var result /selected inventorylist/??
    – Yeremia Danang
    Nov 12 at 12:35











  • I don't know your class InventoryViewModel. If it has similar properties, you can use new InventoryViewModel(), if it is quite different, then I wonder why you would like to do that. The idea behind object oriented programming is that a dog is different than a cat, so don't try to put a can in a dog object
    – Harald Coppoolse
    Nov 13 at 10:00










  • List<InventoryViewModel> InventoriesByLocation = temp.Join(StorageByLocation, i => i.StorageId, s => s.Id, (i, s) => i).Where(i=> i.ExpirationDate<DateTime.Now).GroupBy(s => s.ProductId).Select(g=>new g.Key,Count=g.Count()).ToList(); this is my code. Variable temp is List<inventoryViewModel> too. I need to put the grouped list to List<InventoryViewModel> or put them into variabel that I can access publicly. I can't send var (local variable) to my function.
    – Yeremia Danang
    Nov 14 at 11:34











  • ohh haha, thanks
    – Yeremia Danang
    Nov 14 at 11:51

















up vote
2
down vote













Something like this:



var count = InventoriesByLocation.GroupBy(s => s.ProductId).Count();


Basically, GroupBy returns a type roughly equivalent to IDictionary<int, InventoryViewModel> in your case. So, length of an individual dictionary entry will be the count of a unique ProductId.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2fstackoverflow.com%2fquestions%2f53252830%2fcount-every-data-that-grouped-in-list%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








    up vote
    1
    down vote



    accepted










    So you have a sequence of InventoryViewModels, where every InventoryViewModel has a ProductId.



    You want to group all InventoryViewModels into groups, where every groups contains all InventoryViewModels with the same ProductId. After that you want to count the number of InventoryViewModels in each group, and possibly also some other items. Your example code takes the first element in the group.



    var groupsWithSameProductId = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId)


    Now every group has a Key, which contains the ProductId that is the same for all elements in your group. The group itself is a sequence of all InventoryViewModels that have the ProductId equal to the Key.



    To get the number of InventoryViewModels that have this ProductId, just Count() them. If you want other items, just Select them:



    // continue the LINQ statement
    .Select(group => new

    ProductId = group.Key,
    NrOfInventroyViewModelsWithThisProductId = group.Count(),

    // only if you want other items:
    FirstInventoryViewModel = group.First(),
    Names = group.Select(groupItem => groupItem.Name).ToList(),
    );


    Note, that every groupItem is an InventoryViewModel with ProductId equal to group.Key



    There is an overload of Enumerable.GroupBy that combines the grouping and selecting in one statement:



    var result = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId, // make groups with same productId
    (commonProductId, inventoryViewModelsWithThisCommonProductId) => new

    ProductId = commonProductId,
    Count = inventoryViewModelsWithThisCommonProductId.Count(),
    Names = inventoryViewModelsWithThisCommonProductId
    .Select(inventoryViewModelWithThisCommonProductId.Name)
    .ToList(),
    );





    share|improve this answer




















    • thanks for your explanation and i get it. but i got Anonymous Type: a is newGuid ProductId,int NrOfInventroyViewModelsWithThisProductId and can i get the same type of list. Or the selected item cant turn into same type of list. In this case: List<inventoryfiewmodel> mInventories= var result /selected inventorylist/??
      – Yeremia Danang
      Nov 12 at 12:35











    • I don't know your class InventoryViewModel. If it has similar properties, you can use new InventoryViewModel(), if it is quite different, then I wonder why you would like to do that. The idea behind object oriented programming is that a dog is different than a cat, so don't try to put a can in a dog object
      – Harald Coppoolse
      Nov 13 at 10:00










    • List<InventoryViewModel> InventoriesByLocation = temp.Join(StorageByLocation, i => i.StorageId, s => s.Id, (i, s) => i).Where(i=> i.ExpirationDate<DateTime.Now).GroupBy(s => s.ProductId).Select(g=>new g.Key,Count=g.Count()).ToList(); this is my code. Variable temp is List<inventoryViewModel> too. I need to put the grouped list to List<InventoryViewModel> or put them into variabel that I can access publicly. I can't send var (local variable) to my function.
      – Yeremia Danang
      Nov 14 at 11:34











    • ohh haha, thanks
      – Yeremia Danang
      Nov 14 at 11:51














    up vote
    1
    down vote



    accepted










    So you have a sequence of InventoryViewModels, where every InventoryViewModel has a ProductId.



    You want to group all InventoryViewModels into groups, where every groups contains all InventoryViewModels with the same ProductId. After that you want to count the number of InventoryViewModels in each group, and possibly also some other items. Your example code takes the first element in the group.



    var groupsWithSameProductId = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId)


    Now every group has a Key, which contains the ProductId that is the same for all elements in your group. The group itself is a sequence of all InventoryViewModels that have the ProductId equal to the Key.



    To get the number of InventoryViewModels that have this ProductId, just Count() them. If you want other items, just Select them:



    // continue the LINQ statement
    .Select(group => new

    ProductId = group.Key,
    NrOfInventroyViewModelsWithThisProductId = group.Count(),

    // only if you want other items:
    FirstInventoryViewModel = group.First(),
    Names = group.Select(groupItem => groupItem.Name).ToList(),
    );


    Note, that every groupItem is an InventoryViewModel with ProductId equal to group.Key



    There is an overload of Enumerable.GroupBy that combines the grouping and selecting in one statement:



    var result = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId, // make groups with same productId
    (commonProductId, inventoryViewModelsWithThisCommonProductId) => new

    ProductId = commonProductId,
    Count = inventoryViewModelsWithThisCommonProductId.Count(),
    Names = inventoryViewModelsWithThisCommonProductId
    .Select(inventoryViewModelWithThisCommonProductId.Name)
    .ToList(),
    );





    share|improve this answer




















    • thanks for your explanation and i get it. but i got Anonymous Type: a is newGuid ProductId,int NrOfInventroyViewModelsWithThisProductId and can i get the same type of list. Or the selected item cant turn into same type of list. In this case: List<inventoryfiewmodel> mInventories= var result /selected inventorylist/??
      – Yeremia Danang
      Nov 12 at 12:35











    • I don't know your class InventoryViewModel. If it has similar properties, you can use new InventoryViewModel(), if it is quite different, then I wonder why you would like to do that. The idea behind object oriented programming is that a dog is different than a cat, so don't try to put a can in a dog object
      – Harald Coppoolse
      Nov 13 at 10:00










    • List<InventoryViewModel> InventoriesByLocation = temp.Join(StorageByLocation, i => i.StorageId, s => s.Id, (i, s) => i).Where(i=> i.ExpirationDate<DateTime.Now).GroupBy(s => s.ProductId).Select(g=>new g.Key,Count=g.Count()).ToList(); this is my code. Variable temp is List<inventoryViewModel> too. I need to put the grouped list to List<InventoryViewModel> or put them into variabel that I can access publicly. I can't send var (local variable) to my function.
      – Yeremia Danang
      Nov 14 at 11:34











    • ohh haha, thanks
      – Yeremia Danang
      Nov 14 at 11:51












    up vote
    1
    down vote



    accepted







    up vote
    1
    down vote



    accepted






    So you have a sequence of InventoryViewModels, where every InventoryViewModel has a ProductId.



    You want to group all InventoryViewModels into groups, where every groups contains all InventoryViewModels with the same ProductId. After that you want to count the number of InventoryViewModels in each group, and possibly also some other items. Your example code takes the first element in the group.



    var groupsWithSameProductId = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId)


    Now every group has a Key, which contains the ProductId that is the same for all elements in your group. The group itself is a sequence of all InventoryViewModels that have the ProductId equal to the Key.



    To get the number of InventoryViewModels that have this ProductId, just Count() them. If you want other items, just Select them:



    // continue the LINQ statement
    .Select(group => new

    ProductId = group.Key,
    NrOfInventroyViewModelsWithThisProductId = group.Count(),

    // only if you want other items:
    FirstInventoryViewModel = group.First(),
    Names = group.Select(groupItem => groupItem.Name).ToList(),
    );


    Note, that every groupItem is an InventoryViewModel with ProductId equal to group.Key



    There is an overload of Enumerable.GroupBy that combines the grouping and selecting in one statement:



    var result = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId, // make groups with same productId
    (commonProductId, inventoryViewModelsWithThisCommonProductId) => new

    ProductId = commonProductId,
    Count = inventoryViewModelsWithThisCommonProductId.Count(),
    Names = inventoryViewModelsWithThisCommonProductId
    .Select(inventoryViewModelWithThisCommonProductId.Name)
    .ToList(),
    );





    share|improve this answer












    So you have a sequence of InventoryViewModels, where every InventoryViewModel has a ProductId.



    You want to group all InventoryViewModels into groups, where every groups contains all InventoryViewModels with the same ProductId. After that you want to count the number of InventoryViewModels in each group, and possibly also some other items. Your example code takes the first element in the group.



    var groupsWithSameProductId = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId)


    Now every group has a Key, which contains the ProductId that is the same for all elements in your group. The group itself is a sequence of all InventoryViewModels that have the ProductId equal to the Key.



    To get the number of InventoryViewModels that have this ProductId, just Count() them. If you want other items, just Select them:



    // continue the LINQ statement
    .Select(group => new

    ProductId = group.Key,
    NrOfInventroyViewModelsWithThisProductId = group.Count(),

    // only if you want other items:
    FirstInventoryViewModel = group.First(),
    Names = group.Select(groupItem => groupItem.Name).ToList(),
    );


    Note, that every groupItem is an InventoryViewModel with ProductId equal to group.Key



    There is an overload of Enumerable.GroupBy that combines the grouping and selecting in one statement:



    var result = inventoryViewModels
    .GroupBy(inventoryViewModel => inventoryViewModel.ProductId, // make groups with same productId
    (commonProductId, inventoryViewModelsWithThisCommonProductId) => new

    ProductId = commonProductId,
    Count = inventoryViewModelsWithThisCommonProductId.Count(),
    Names = inventoryViewModelsWithThisCommonProductId
    .Select(inventoryViewModelWithThisCommonProductId.Name)
    .ToList(),
    );






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 12 at 8:17









    Harald Coppoolse

    11.2k12959




    11.2k12959











    • thanks for your explanation and i get it. but i got Anonymous Type: a is newGuid ProductId,int NrOfInventroyViewModelsWithThisProductId and can i get the same type of list. Or the selected item cant turn into same type of list. In this case: List<inventoryfiewmodel> mInventories= var result /selected inventorylist/??
      – Yeremia Danang
      Nov 12 at 12:35











    • I don't know your class InventoryViewModel. If it has similar properties, you can use new InventoryViewModel(), if it is quite different, then I wonder why you would like to do that. The idea behind object oriented programming is that a dog is different than a cat, so don't try to put a can in a dog object
      – Harald Coppoolse
      Nov 13 at 10:00










    • List<InventoryViewModel> InventoriesByLocation = temp.Join(StorageByLocation, i => i.StorageId, s => s.Id, (i, s) => i).Where(i=> i.ExpirationDate<DateTime.Now).GroupBy(s => s.ProductId).Select(g=>new g.Key,Count=g.Count()).ToList(); this is my code. Variable temp is List<inventoryViewModel> too. I need to put the grouped list to List<InventoryViewModel> or put them into variabel that I can access publicly. I can't send var (local variable) to my function.
      – Yeremia Danang
      Nov 14 at 11:34











    • ohh haha, thanks
      – Yeremia Danang
      Nov 14 at 11:51
















    • thanks for your explanation and i get it. but i got Anonymous Type: a is newGuid ProductId,int NrOfInventroyViewModelsWithThisProductId and can i get the same type of list. Or the selected item cant turn into same type of list. In this case: List<inventoryfiewmodel> mInventories= var result /selected inventorylist/??
      – Yeremia Danang
      Nov 12 at 12:35











    • I don't know your class InventoryViewModel. If it has similar properties, you can use new InventoryViewModel(), if it is quite different, then I wonder why you would like to do that. The idea behind object oriented programming is that a dog is different than a cat, so don't try to put a can in a dog object
      – Harald Coppoolse
      Nov 13 at 10:00










    • List<InventoryViewModel> InventoriesByLocation = temp.Join(StorageByLocation, i => i.StorageId, s => s.Id, (i, s) => i).Where(i=> i.ExpirationDate<DateTime.Now).GroupBy(s => s.ProductId).Select(g=>new g.Key,Count=g.Count()).ToList(); this is my code. Variable temp is List<inventoryViewModel> too. I need to put the grouped list to List<InventoryViewModel> or put them into variabel that I can access publicly. I can't send var (local variable) to my function.
      – Yeremia Danang
      Nov 14 at 11:34











    • ohh haha, thanks
      – Yeremia Danang
      Nov 14 at 11:51















    thanks for your explanation and i get it. but i got Anonymous Type: a is newGuid ProductId,int NrOfInventroyViewModelsWithThisProductId and can i get the same type of list. Or the selected item cant turn into same type of list. In this case: List<inventoryfiewmodel> mInventories= var result /selected inventorylist/??
    – Yeremia Danang
    Nov 12 at 12:35





    thanks for your explanation and i get it. but i got Anonymous Type: a is newGuid ProductId,int NrOfInventroyViewModelsWithThisProductId and can i get the same type of list. Or the selected item cant turn into same type of list. In this case: List<inventoryfiewmodel> mInventories= var result /selected inventorylist/??
    – Yeremia Danang
    Nov 12 at 12:35













    I don't know your class InventoryViewModel. If it has similar properties, you can use new InventoryViewModel(), if it is quite different, then I wonder why you would like to do that. The idea behind object oriented programming is that a dog is different than a cat, so don't try to put a can in a dog object
    – Harald Coppoolse
    Nov 13 at 10:00




    I don't know your class InventoryViewModel. If it has similar properties, you can use new InventoryViewModel(), if it is quite different, then I wonder why you would like to do that. The idea behind object oriented programming is that a dog is different than a cat, so don't try to put a can in a dog object
    – Harald Coppoolse
    Nov 13 at 10:00












    List<InventoryViewModel> InventoriesByLocation = temp.Join(StorageByLocation, i => i.StorageId, s => s.Id, (i, s) => i).Where(i=> i.ExpirationDate<DateTime.Now).GroupBy(s => s.ProductId).Select(g=>new g.Key,Count=g.Count()).ToList(); this is my code. Variable temp is List<inventoryViewModel> too. I need to put the grouped list to List<InventoryViewModel> or put them into variabel that I can access publicly. I can't send var (local variable) to my function.
    – Yeremia Danang
    Nov 14 at 11:34





    List<InventoryViewModel> InventoriesByLocation = temp.Join(StorageByLocation, i => i.StorageId, s => s.Id, (i, s) => i).Where(i=> i.ExpirationDate<DateTime.Now).GroupBy(s => s.ProductId).Select(g=>new g.Key,Count=g.Count()).ToList(); this is my code. Variable temp is List<inventoryViewModel> too. I need to put the grouped list to List<InventoryViewModel> or put them into variabel that I can access publicly. I can't send var (local variable) to my function.
    – Yeremia Danang
    Nov 14 at 11:34













    ohh haha, thanks
    – Yeremia Danang
    Nov 14 at 11:51




    ohh haha, thanks
    – Yeremia Danang
    Nov 14 at 11:51












    up vote
    2
    down vote













    Something like this:



    var count = InventoriesByLocation.GroupBy(s => s.ProductId).Count();


    Basically, GroupBy returns a type roughly equivalent to IDictionary<int, InventoryViewModel> in your case. So, length of an individual dictionary entry will be the count of a unique ProductId.






    share|improve this answer


























      up vote
      2
      down vote













      Something like this:



      var count = InventoriesByLocation.GroupBy(s => s.ProductId).Count();


      Basically, GroupBy returns a type roughly equivalent to IDictionary<int, InventoryViewModel> in your case. So, length of an individual dictionary entry will be the count of a unique ProductId.






      share|improve this answer
























        up vote
        2
        down vote










        up vote
        2
        down vote









        Something like this:



        var count = InventoriesByLocation.GroupBy(s => s.ProductId).Count();


        Basically, GroupBy returns a type roughly equivalent to IDictionary<int, InventoryViewModel> in your case. So, length of an individual dictionary entry will be the count of a unique ProductId.






        share|improve this answer














        Something like this:



        var count = InventoriesByLocation.GroupBy(s => s.ProductId).Count();


        Basically, GroupBy returns a type roughly equivalent to IDictionary<int, InventoryViewModel> in your case. So, length of an individual dictionary entry will be the count of a unique ProductId.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 11 at 20:52









        mjwills

        14.6k42439




        14.6k42439










        answered Nov 11 at 20:20









        Sergey Shulik

        678824




        678824



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • 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.

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





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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.

            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%2fstackoverflow.com%2fquestions%2f53252830%2fcount-every-data-that-grouped-in-list%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

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            政党

            天津地下鉄3号線