## 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
from posthog.models import (
    Action,
    ActionStep,
    Cohort,
    CohortPeople,
    Entity,
    Event,
    Filter,
    Person,
    Team,
)
from posthog.models.utils import Percentile
from posthog.queries.lifecycle import LifecycleTrend
from posthog.utils import append_data
from .base import BaseQuery, filter_events, handle_compare, process_entity_for_events
FREQ_MAP = {"minute": "60S", "hour": "H", "day": "D", "week": "W", "month": "MS"}
MATH_TO_AGGREGATE_FUNCTION: Dict[str, Callable] = {
    "sum": Sum,
    "avg": Avg,
    "min": Min,
    "max": Max,
    "median": lambda expr: Percentile(0.5, expr),
    "p90": lambda expr: Percentile(0.9, expr),
    "p95": lambda expr: Percentile(0.95, expr),
    "p99": lambda expr: Percentile(0.99, expr),
}
MATH_TO_AGGREGATE_STRING: Dict[str, str] = {
    "sum": "SUM({math_prop})",
    "avg": "AVG({math_prop})",
    "min": "MIN({math_prop})",