## 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/sessions/sessions.py
all_sessions, sessions_sql_params = self.build_all_sessions_query(events)
        if filter.session == SESSION_AVG:
            if not filter.date_from:
                filter = Filter(
                    data={
                        **filter._data,
                        "date_from": Event.objects.filter(team=team)
                        .order_by("timestamp")[0]
                        .timestamp.replace(hour=0, minute=0, second=0, microsecond=0)
                        .isoformat(),
                    }
                )
            return self._session_avg(all_sessions, sessions_sql_params, filter)
        else:  
            return self._session_dist(all_sessions, sessions_sql_params)
    def events_query(self, filter: Filter, team: Team) -> QuerySet:
        return (
            Event.objects.filter(team=team)
            .add_person_id(team.pk)
            .filter(properties_to_Q(filter.properties, team_id=team.pk))
            .order_by("-timestamp")
        )
    def build_all_sessions_query(self, events: QuerySet, _date_gte=Q()) -> Tuple[Query, QueryParams]: