## Is your feature request related to a problem?

There's only 2 files where we use pandas, but pandas is 49MB and numpy is another 86MB, slowing down builds massively.

## Describe the solution you'd like

Replace pandas with a pure SQL/Python solution in
- posthog/queries/trends.py
- posthog/queries/sessions.py

Both of those have equivalent examples in Clickhouse (ee/clickhouse) that don't use Pandas.

## Describe alternatives you've considered

Continue using Pandas and clogging builds

## Additional context



#### *Thank you* for your feature request – we love each and every one!

posthog/queries/trends.py
filtered_events: QuerySet, filter: Filter, entity: Entity, team_id: int, breakdown_value: Union[str, int]
) -> int:
    if len(filtered_events) == 0:
        return 0
    breakdown_filter: Dict[str, Union[bool, str, int]] = {}
    if filter.breakdown_type == "cohort":
        breakdown_filter = {"cohort_{}".format(breakdown_value): True}
    else:
        breakdown_filter = {"properties__{}".format(filter.breakdown): breakdown_value}
    filtered_events = filtered_events.filter(**breakdown_filter)
    return get_aggregate_total(filtered_events, entity)
def process_math(query: QuerySet, entity: Entity) -> QuerySet:
    if entity.math == "dau":
        
        query = query.annotate(count=Count("person_id", distinct=True))
    elif entity.math in MATH_TO_AGGREGATE_FUNCTION:
        
        query = query.annotate(
            count=MATH_TO_AGGREGATE_FUNCTION[entity.math](
                Cast(RawSQL('"posthog_event"."properties"->>%s', (entity.math_property,)), output_field=FloatField(),)
            )
        )
        
        
        
        query = query.extra(
            where=['jsonb_typeof("posthog_event"."properties"->%s) = \'number\''], params=[entity.math_property],
        )
    return query
def breakdown_label(entity: Entity, value: Union[str, int]) -> Dict[str, Optional[Union[str, int]]]: