Data Science, Python, Pandas.
summed_articles = dfd.groupby([‘article’, ‘coming_from’])\ .sum()\ .reset_index()\ .compute() But it’s best not to store it in memory — we’ll have to perform the aggregation later on and that will be memory-demanding. So let’s write it down (as its being calculated) directly to hard drive instead,