程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

python_ data_ analysis_ and_ mining_ action-master-12

編輯:Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=W1401
"""
Created on Mon Nov 6 21:04:24 2017
@author: lu
"""
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
"""
This part of the code mainly uses Python Connect to database , Extract data for analysis .
the j So before you run the code, you need to say sql Statement to insert data into mysql In the database
Note that you need to create one in advance database, And add the use of... At the beginning database The sentence of
mysql -uroot -p < 7law.sql
Need to wait for a while
This part of the code did not run , There are certain problems
count107--> Statistics 107 Category
programmer_1--> Have a general understanding of the intention of processing data
programmer_2--> Extract required data , And save it to the database
programmer_3--> Data filtering , Save to the database
programmer_4--> Merge certain features into one feature , Save to database
programmer_5--> Recommendation matrix
"""
def count107(i):
j = i[["fullURL"]][i["fullURLId"].str.contains("107")].copy()
# Add an empty column
j["type"] = None
# Use regular to match , And rename
j["type"][j["fullURL"].str.contains("info/.+?/")] = u" Knowledge home page "
j["ty

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved