Skip to content

Instantly share code, notes, and snippets.

@Zmey56
Last active September 2, 2022 20:27
Show Gist options
  • Save Zmey56/0dd0c2a3e1704b134ff28fef5871d9a6 to your computer and use it in GitHub Desktop.
Save Zmey56/0dd0c2a3e1704b134ff28fef5871d9a6 to your computer and use it in GitHub Desktop.
query_msg_q = """
select
toDate(time) as date
,count(distinct user_id) as users_msg
,count(user_id) as msg
, msg / users_msg as mpu
from simulator_20220620.message_actions
where toDate(time) between today() - 8 and today() - 1
group by date
order by date
"""
data_msg = pd.DataFrame(ph.read_clickhouse(query=query_msg_q, connection=connection))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment