Skip to content

Instantly share code, notes, and snippets.

View masoud-saedi's full-sized avatar

Masoud Saedi masoud-saedi

View GitHub Profile
@masoud-saedi
masoud-saedi / globox_abtest_data_analysis_queries.sql
Last active March 18, 2024 11:12
Data Analysis Queries for GloBox A/B Test
-- * Data Extraction and Analysis:
-- Q: What are the start and end dates of the experiment?
-- A: 2023-01-25 to 2023-02-06
SELECT MIN(join_dt), MAX(join_dt)
FROM groups;
-- Q: How many total users were in the experiment?
-- A: 48,943
SELECT COUNT(uid)
@masoud-saedi
masoud-saedi / portugal_crime_data_cleaning.py
Created July 31, 2023 00:38
A Python script to clean and reprocess the crime data in Portugal from 2009 to 2017. The script handles missing values, renames columns, and transforms data types to make it suitable for analysis. The cleaned dataset can be used for visualization and exploration. Data source: Kaggle https://bit.ly/3QitzNW
import pandas as pd
# Load the Raw Data:
df = pd.read_csv('crimesportugal.csv', delimiter=';')
# Define Column Names:
column_names = {
'total': 'Total Crime',
'vdom': 'Domestic Violence',
'fur_veiculo': 'Vehicles Stolen',
@masoud-saedi
masoud-saedi / tavel_tide_cohort_sql_queries.sql
Last active February 28, 2024 16:27
SQL Queries for TravelTide Customer Segmentation Project
-- Cohort definition:
WITH cohort_users AS (
SELECT user_id
FROM sessions
WHERE session_start > '2023-01-04'
GROUP BY user_id
HAVING COUNT(session_id) > 7
),
-- Using for calculating the distance between two airports in the final query: