mdbq 3.4.8__py3-none-any.whl → 3.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mdbq/aggregation/query_data.py
CHANGED
@@ -1439,6 +1439,9 @@ class MysqlDatasQuery:
|
|
1439
1439
|
)
|
1440
1440
|
__res.append(df)
|
1441
1441
|
df = pd.concat(__res, ignore_index=True)
|
1442
|
+
# df['日期'] = pd.to_datetime(df['日期'], format='%Y-%m-%d', errors='ignore') # 转换日期列
|
1443
|
+
df = df.astype({'访客数': 'int64'}, errors='ignore')
|
1444
|
+
df = df[df['访客数'] > 0]
|
1442
1445
|
df.drop_duplicates(subset=['日期', '店铺名称', '类别', '来源构成', '一级来源', '二级来源', '三级来源', '访客数'], keep='last', inplace=True, ignore_index=True)
|
1443
1446
|
# 包含三级来源名称和预设索引值列
|
1444
1447
|
# 截取 从上月1日 至 今天的花费数据, 推广款式按此数据从高到低排序(商品图+排序)
|
@@ -3850,7 +3853,8 @@ def main(days=150, months=3):
|
|
3850
3853
|
'市场数据3',
|
3851
3854
|
]
|
3852
3855
|
# 使用 ThreadPoolExecutor 来并行运行
|
3853
|
-
with concurrent.futures.ThreadPoolExecutor() as executor:
|
3856
|
+
# with concurrent.futures.ThreadPoolExecutor() as executor:
|
3857
|
+
with concurrent.futures.ProcessPoolExecutor() as executor:
|
3854
3858
|
for step in range(len(db_list)):
|
3855
3859
|
future_to_function = {
|
3856
3860
|
executor.submit(
|
@@ -3868,7 +3872,8 @@ def main(days=150, months=3):
|
|
3868
3872
|
# 2. 数据聚合
|
3869
3873
|
query_list = [query1, query2, query3]
|
3870
3874
|
# 使用 ThreadPoolExecutor 来并行运行
|
3871
|
-
with concurrent.futures.ThreadPoolExecutor() as executor:
|
3875
|
+
# with concurrent.futures.ThreadPoolExecutor() as executor:
|
3876
|
+
with concurrent.futures.ProcessPoolExecutor() as executor:
|
3872
3877
|
for func_query in query_list:
|
3873
3878
|
future_to_function = {
|
3874
3879
|
executor.submit(
|
@@ -3890,14 +3895,15 @@ def main(days=150, months=3):
|
|
3890
3895
|
|
3891
3896
|
|
3892
3897
|
if __name__ == '__main__':
|
3893
|
-
main(
|
3894
|
-
|
3895
|
-
|
3896
|
-
)
|
3898
|
+
# main(
|
3899
|
+
# days=3, # 清理聚合数据的日期长度
|
3900
|
+
# months=1 # 生成聚合数据的长度
|
3901
|
+
# )
|
3897
3902
|
|
3898
|
-
# query_list = [query1, query2]
|
3903
|
+
# query_list = [query1, query2, query3]
|
3899
3904
|
# # 使用 ThreadPoolExecutor 来并行运行
|
3900
|
-
# with concurrent.futures.ThreadPoolExecutor() as executor:
|
3905
|
+
# # with concurrent.futures.ThreadPoolExecutor() as executor:
|
3906
|
+
# with concurrent.futures.ProcessPoolExecutor() as executor:
|
3901
3907
|
# for func_query in query_list:
|
3902
3908
|
# future_to_function = {
|
3903
3909
|
# executor.submit(
|
@@ -3907,17 +3913,8 @@ if __name__ == '__main__':
|
|
3907
3913
|
# ),
|
3908
3914
|
# }
|
3909
3915
|
|
3910
|
-
|
3911
|
-
#
|
3912
|
-
#
|
3913
|
-
|
3914
|
-
# is_mongo=False,
|
3915
|
-
# is_mysql=True,
|
3916
|
-
# )
|
3917
|
-
|
3918
|
-
# query3(months=2, less_dict=[])
|
3916
|
+
sdq = MysqlDatasQuery() # 实例化数据处理类
|
3917
|
+
sdq.months = 2 # 设置数据周期, 1 表示近 2 个月
|
3918
|
+
sdq.update_service = True # 调试时加,true: 将数据写入 mysql 服务器
|
3919
|
+
sdq.dplyd(db_name='聚合数据', table_name='店铺流量来源构成')
|
3919
3920
|
|
3920
|
-
# sdq = MysqlDatasQuery() # 实例化数据处理类
|
3921
|
-
# sdq.months = 1 # 设置数据周期, 1 表示近 2 个月
|
3922
|
-
# sdq.update_service = True # 调试时加,true: 将数据写入 mysql 服务器
|
3923
|
-
# sdq.item_up()
|
@@ -4,7 +4,7 @@ mdbq/aggregation/__init__.py,sha256=EeDqX2Aml6SPx8363J-v1lz0EcZtgwIBYyCJV6CcEDU,
|
|
4
4
|
mdbq/aggregation/aggregation.py,sha256=-yzApnlqSN2L0E1YMu5ml-W827qpKQvWPCOI7jj2kzY,80264
|
5
5
|
mdbq/aggregation/datashow.py,sha256=1AYSIDkdUx-4as1Ax2rPj0cExM9d-qFMrFYLAaPHNuk,54962
|
6
6
|
mdbq/aggregation/optimize_data.py,sha256=RXIv7cACCgYyehAxMjUYi_S7rVyjIwXKWMaM3nduGtA,3068
|
7
|
-
mdbq/aggregation/query_data.py,sha256=
|
7
|
+
mdbq/aggregation/query_data.py,sha256=JJ7OSrzWAORAah7LJIC8cXa7ikTUWYy-U-inDNa7baU,179119
|
8
8
|
mdbq/bdup/__init__.py,sha256=AkhsGk81SkG1c8FqDH5tRq-8MZmFobVbN60DTyukYTY,28
|
9
9
|
mdbq/bdup/bdup.py,sha256=LAV0TgnQpc-LB-YuJthxb0U42_VkPidzQzAagan46lU,4234
|
10
10
|
mdbq/config/__init__.py,sha256=jso1oHcy6cJEfa7udS_9uO5X6kZLoPBF8l3wCYmr5dM,18
|
@@ -34,7 +34,7 @@ mdbq/pbix/refresh_all.py,sha256=OBT9EewSZ0aRS9vL_FflVn74d4l2G00wzHiikCC4TC0,5926
|
|
34
34
|
mdbq/pbix/refresh_all_old.py,sha256=_pq3WSQ728GPtEG5pfsZI2uTJhU8D6ra-htIk1JXYzw,7192
|
35
35
|
mdbq/spider/__init__.py,sha256=RBMFXGy_jd1HXZhngB2T2XTvJqki8P_Fr-pBcwijnew,18
|
36
36
|
mdbq/spider/aikucun.py,sha256=zOacjrJ3MvToyuugA68xB-oN6RKj8K3GxMKudnln9EA,22207
|
37
|
-
mdbq-3.
|
38
|
-
mdbq-3.
|
39
|
-
mdbq-3.
|
40
|
-
mdbq-3.
|
37
|
+
mdbq-3.5.0.dist-info/METADATA,sha256=2oZVnoWshrH8JUDGJr6WuY1t2RCLcJF36NleNi9D524,243
|
38
|
+
mdbq-3.5.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
39
|
+
mdbq-3.5.0.dist-info/top_level.txt,sha256=2FQ-uLnCSB-OwFiWntzmwosW3X2Xqsg0ewh1axsaylA,5
|
40
|
+
mdbq-3.5.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|