## 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
ret_dict: Dict[str, Optional[Union[str, int]]] = {}
    if not value or not isinstance(value, str) or "cohort_" not in value:
        ret_dict["label"] = "{} - {}".format(
            entity.name, value if value and value != "None" and value != "nan" else "Other",
        )
        ret_dict["breakdown_value"] = value if value and not pd.isna(value) else None
    else:
        if value == "cohort_all":
            ret_dict["label"] = "{} - all users".format(entity.name)
            ret_dict["breakdown_value"] = "all"
        else:
            cohort = Cohort.objects.get(pk=value.replace("cohort_", ""))
            ret_dict["label"] = "{} - {}".format(entity.name, cohort.name)
            ret_dict["breakdown_value"] = cohort.pk
    return ret_dict
class Trends(LifecycleTrend, BaseQuery):
    def _serialize_entity(self, entity: Entity, filter: Filter, team_id: int) -> List[Dict[str, Any]]:
        if filter.breakdown:
            result = self._serialize_breakdown(entity, filter, team_id)
        elif filter.shown_as == TRENDS_LIFECYCLE:
            result = self._serialize_lifecycle(entity, filter, team_id)
        else:
            result = self._format_normal_query(entity, filter, team_id)
        serialized_data = self._format_serialized(entity, result)
        if filter.display == TRENDS_CUMULATIVE:
            serialized_data = self._handle_cumulative(serialized_data)
        return serialized_data
    def _set_default_dates(self, filter: Filter, team_id: int) -> Filter: