大数据行业十分火热,本人认为python是比较强大的分析工具,在网易云课堂上学习了python数据分析。做了案例,写下代码分析过程以及分析结论。
以下是婚恋配对的python数据分析项目。
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 7 15:56:04 2019
@author: Administrator
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
import os
import warnings
warnings.filterwarnings("ignore")
from bokeh.plotting import figure,show,output_file
from bokeh.models import ColumnDataSource,HoverTool
sample_m2=create_sample(100,"m")
sample_f2=create_sample(100,"f")
sample_m2['strategy']=np.random.choice([1,2,3],100)
test_m2=sample_m2.copy()
test_f2=sample_f2.copy()
n=1
starttime=time.time()
success_roundn=different_strategy(test_m2,test_f2,n)
match_success2=success_roundn#把每一轮匹配成功的success_roundn 放到match_success2这个空壳子里去
test_m2=test_m2.drop(success_roundn["m"].tolist())
test_f2=test_f2.drop(succes