I copied the title and concept for this question from here. I have
data = {{"ID", "Value"}, {1, 48}, {1, 45}, {1, 52}, {1, 43}, {1,
41}, {2, 50}, {2, 42}, {2, 51}, {2, 52}, {bb, 52}, {bb, 54}, {ccdd,
3020}, {dd, 2025}, {dd, 2527}, {ddcc, 2730}};
I want to create a new column called "Count" so that:
result = {{"ID", "Value", "Count"}, {1, 48, 1}, {1, 45, 2}, {1, 52,
3}, {1, 43, 4}, {1, 41, 5}, {2, 50, 1}, {2, 42, 2}, {2, 51,
3}, {2, 52, 4}, {bb, 52, 1}, {bb, 54, 2}, {ccdd, 3020, 1}, {dd, 2025,
12}, {dd, 2527, 23}, {ddcc, 2730, 31}};
I have a huge data with almost 2 billion observations. Therefore, efficient coding would save a lot of time and energy. As always, help is much appreciated. Thanks