import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
pd.set_option('display.max_columns', None)
%matplotlib inline

"""
Explanation: Import libraries
End of explanation
"""


source_path = "/Users/sandrapietrowska/Documents/Trainings/luigi/data_source/"

"""
Explanation: Define source paths
End of explanation
"""


raw_dataset = pd.read_csv(source_path + "Speed_Dating_Data.csv")

"""
Explanation: Import data
End of explanation
"""


raw_dataset.shape

raw_dataset.head()

raw_dataset.dtypes.value_counts()

"""
Explanation: Data exploration
Shape, types
End of explanation
"""


raw_dataset.isnull().sum().head(10)

summary = raw_dataset.describe().transpose()
print summary.head(15)

plt.hist(raw_dataset['age'].dropna());

"""
Explanation: Missing values
End of explanation
"""


# Attractiveness
plt.hist(raw_dataset['attr_o'].dropna());

# Sincere
plt.hist(raw_dataset['sinc_o'].dropna());

# Intelligent
plt.hist(raw_dataset['intel_o'].dropna()) ;

# Fun
plt.hist(raw_dataset['fun_o'].dropna());

# Ambitious
plt.hist(raw_dataset['amb_o'].dropna());

"""
Explanation: We want to know what you look for in the opposite sex.
End of explanation
"""


raw_dataset.groupby('date').iid.nunique().sort_values(ascending=False)

"""
Explanation: What is your primary goal in participating in this event?

Seemed like a fun night out=1, 
To meet new people=2, 
To get a date=3, 
Looking for a serious relationship=4, 
To say I did it=5, 
Other=6
End of explanation
"""


raw_dataset.groupby('go_out').iid.nunique().sort_values(ascending=False)

raw_dataset.groupby('career').iid.nunique().sort_values(ascending=False).head(10)

"""
Explanation: In general, how frequently do you go on dates?

Several times a week=1
Twice a week=2
Once a week=3
Twice a month=4
Once a month=5
Several times a year=6
Almost never=7
End of explanation
"""


