## 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
cohorts = Cohort.objects.filter(team_id=team_id, pk__in=[b for b in breakdown if b != "all"])
    annotations: Dict[str, Union[Value, Exists]] = {}
    for cohort in cohorts:
        annotations["cohort_{}".format(cohort.pk)] = Exists(
            CohortPeople.objects.filter(cohort=cohort.pk, person_id=OuterRef("person_id")).only("id")
        )
    if "all" in breakdown:
        annotations["cohort_all"] = Value(True, output_field=BooleanField())
    return annotations
def add_person_properties_annotations(team_id: int, breakdown: str) -> Dict[str, Subquery]:
    person_properties = Subquery(
        Person.objects.filter(team_id=team_id, id=OuterRef("person_id")).values("properties__{}".format(breakdown))
    )
    annotations = {}
    annotations["properties__{}".format(breakdown)] = person_properties
    return annotations
def aggregate_by_interval(
    events: QuerySet, team_id: int, entity: Entity, filter: Filter, breakdown: Optional[str] = None,
) -> Tuple[Dict[str, Any], QuerySet]:
    interval = filter.interval if filter.interval else "day"
    interval_annotation = get_interval_annotation(interval)
    filtered_events = events.filter(
        filter_events(team_id, filter, entity, interval_annotation=interval_annotation[interval])
    )