Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-18137

[Python][Docs] Allow passing no aggregations to TableGroupBy.aggregate

    XMLWordPrintableJSON

Details

    Description

      If we could allow TableGroupBy.aggregate to accept no aggregation functions then it would behave like pandas drop_duplicates.

      t.group_by(['keys', 'values']).aggregate()
      

      I did some naive benchmarks and looks like it should be 30% faster than converting to pandas and deduplicating. This was my naive test:

       t.append_column('i', pa.array([1]*len(t),pa.int64())).group_by(['keys', 'values']).aggregate([("i", "max")]).drop(['i_max'])
      

      And on small 5M table it took 245ms while 359ms for t.to_pandas().drop_duplicates()

      Actual aggregation without adding dummy column should be  even faster still will allow drop_duplicates functionality until better implementation arrives

      Attachments

        Issue Links

          Activity

            People

              jacek.pliszka Jacek Pliszka
              jacek.pliszka Jacek Pliszka
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h