## 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
date_from: Optional[datetime.datetime],
    date_to: Optional[datetime.datetime],
    aggregates: QuerySet,
    interval: str,
    breakdown: Optional[str] = None,
) -> Dict[str, Dict[datetime.datetime, int]]:
    response = {}
    if interval == "day":
        if date_from:
            date_from = date_from.replace(hour=0, minute=0, second=0, microsecond=0)
        if date_to:
            date_to = date_to.replace(hour=0, minute=0, second=0, microsecond=0)
    time_index = pd.date_range(date_from, date_to, freq=FREQ_MAP[interval])
    if len(aggregates) > 0:
        dataframe = build_dataframe(aggregates, interval, breakdown)
        
        if breakdown and dataframe["breakdown"].nunique() > 20:
            counts = (
                dataframe.groupby(["breakdown"])["count"]
                .sum()
                .reset_index(name="total")
                .sort_values(by=["total"], ascending=False)[:20]
            )
            top_breakdown = counts["breakdown"].to_list()
            dataframe = dataframe[dataframe.breakdown.isin(top_breakdown)]