mns-common 1.3.1.2__py3-none-any.whl → 1.3.1.3__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.
Potentially problematic release.
This version of mns-common might be problematic. Click here for more details.
- mns_common/component/concept/ths_concept_common_service_api.py +27 -6
- {mns_common-1.3.1.2.dist-info → mns_common-1.3.1.3.dist-info}/METADATA +1 -1
- {mns_common-1.3.1.2.dist-info → mns_common-1.3.1.3.dist-info}/RECORD +5 -5
- {mns_common-1.3.1.2.dist-info → mns_common-1.3.1.3.dist-info}/WHEEL +0 -0
- {mns_common-1.3.1.2.dist-info → mns_common-1.3.1.3.dist-info}/top_level.txt +0 -0
|
@@ -68,6 +68,8 @@ def set_ths_concept(symbol, df):
|
|
|
68
68
|
|
|
69
69
|
df['ths_concept_name_list_str'] = "-"
|
|
70
70
|
|
|
71
|
+
df['ths_concept_list'] = [[] for _ in range(len(df))]
|
|
72
|
+
|
|
71
73
|
if ths_stock_concept_detail.shape[0] == 0:
|
|
72
74
|
return df
|
|
73
75
|
|
|
@@ -83,6 +85,8 @@ def set_ths_concept(symbol, df):
|
|
|
83
85
|
ths_stock_concept_detail = ths_stock_concept_detail[[
|
|
84
86
|
'concept_code',
|
|
85
87
|
'concept_name',
|
|
88
|
+
'grade',
|
|
89
|
+
'remark',
|
|
86
90
|
'str_day',
|
|
87
91
|
'str_now_time',
|
|
88
92
|
'concept_create_day']]
|
|
@@ -91,12 +95,17 @@ def set_ths_concept(symbol, df):
|
|
|
91
95
|
|
|
92
96
|
df.loc[:, 'ths_concept_list_info'] = ths_stock_concept_detail.to_string(index=False)
|
|
93
97
|
df.loc[:, 'ths_concept_name_list_str'] = concept_name_str
|
|
98
|
+
ths_concept_list_record = ths_stock_concept_detail.to_dict(orient='records')
|
|
99
|
+
df.at[df.index[0], 'ths_concept_list'] = ths_concept_list_record
|
|
94
100
|
|
|
95
101
|
ths_effective_concept_list = get_all_ths_effective_concept()
|
|
96
102
|
ths_effective_concept_code_list = list(ths_effective_concept_list['symbol'])
|
|
97
103
|
|
|
98
104
|
ths_stock_concept_detail_effective = ths_stock_concept_detail.loc[
|
|
99
105
|
ths_stock_concept_detail['concept_code'].isin(ths_effective_concept_code_list)]
|
|
106
|
+
|
|
107
|
+
ths_stock_concept_detail_effective = ths_stock_concept_detail_effective.sort_values(by=['concept_code'],
|
|
108
|
+
ascending=False)
|
|
100
109
|
ths_concept_count = ths_stock_concept_detail_effective.shape[0]
|
|
101
110
|
|
|
102
111
|
df.loc[:, 'ths_concept_count'] = ths_concept_count
|
|
@@ -116,6 +125,21 @@ def set_ths_concept(symbol, df):
|
|
|
116
125
|
|
|
117
126
|
df['ths_concept_sync_day'] = list(ths_stock_concept_detail_last_one['str_day'])[0]
|
|
118
127
|
|
|
128
|
+
ths_stock_concept_detail_effective = ths_stock_concept_detail_effective.sort_values(by=['grade'],
|
|
129
|
+
ascending=False)
|
|
130
|
+
|
|
131
|
+
# 最相关的概念
|
|
132
|
+
ths_stock_concept_detail_most_relative_one = ths_stock_concept_detail_effective.iloc[0:1]
|
|
133
|
+
|
|
134
|
+
if ths_stock_concept_detail_most_relative_one['concept_name'] is None:
|
|
135
|
+
df['ths_concept_most_relative_name'] = "未有"
|
|
136
|
+
else:
|
|
137
|
+
df['ths_concept_most_relative_name'] = list(ths_stock_concept_detail_last_one['concept_name'])[0]
|
|
138
|
+
if ths_stock_concept_detail_most_relative_one['concept_code'] is None:
|
|
139
|
+
df['ths_concept_most_relative_code'] = 0
|
|
140
|
+
else:
|
|
141
|
+
df['ths_concept_most_relative_code'] = list(ths_stock_concept_detail_most_relative_one['concept_code'])[0]
|
|
142
|
+
|
|
119
143
|
return df
|
|
120
144
|
|
|
121
145
|
|
|
@@ -235,9 +259,6 @@ def get_choose_effective_ths_concept_no_cache():
|
|
|
235
259
|
|
|
236
260
|
|
|
237
261
|
if __name__ == '__main__':
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
get_one_symbol_all_ths_concept(symbol_test)
|
|
242
|
-
clear_one_concept_cache(symbol_test)
|
|
243
|
-
print(1)
|
|
262
|
+
symbol_test = '300085'
|
|
263
|
+
company_info_df = mongodb_util.find_query_data('company_info', {"symbol": symbol_test})
|
|
264
|
+
set_ths_concept(symbol_test, company_info_df)
|
|
@@ -70,7 +70,7 @@ mns_common/component/company/company_common_service_api.py,sha256=pqb11v5y0uFWJt
|
|
|
70
70
|
mns_common/component/company/company_common_service_new_api.py,sha256=lSPsNzvxOK7MEHtXz8ZaBV3haCXIQY8Bs8hMPYH5V_U,5542
|
|
71
71
|
mns_common/component/concept/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
72
72
|
mns_common/component/concept/kpl_concept_common_service_api.py,sha256=Ruc3INOhVjB0X1LeMRX0zL3uhv9OLweG2hj6wkZffow,3235
|
|
73
|
-
mns_common/component/concept/ths_concept_common_service_api.py,sha256=
|
|
73
|
+
mns_common/component/concept/ths_concept_common_service_api.py,sha256=tlOFU4Sg29RXWlMz6_RAsa1tTwnQThmxgwXZoRoW4VI,11559
|
|
74
74
|
mns_common/component/cookie/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
75
75
|
mns_common/component/cookie/cookie_info_service.py,sha256=IIFKj84dnBrUOt2Wl6kbCj-BDdFX_X9z8IIk4LxLNTc,754
|
|
76
76
|
mns_common/component/data/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
@@ -125,7 +125,7 @@ mns_common/utils/date_handle_util.py,sha256=P4WJUmoDpo4IoCrt2z4keyr7pqXHKmCZBVod
|
|
|
125
125
|
mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
|
|
126
126
|
mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
|
|
127
127
|
mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
|
|
128
|
-
mns_common-1.3.1.
|
|
129
|
-
mns_common-1.3.1.
|
|
130
|
-
mns_common-1.3.1.
|
|
131
|
-
mns_common-1.3.1.
|
|
128
|
+
mns_common-1.3.1.3.dist-info/METADATA,sha256=IB2w6l4kNXgezNtBQhxY4SsgtbdWfUBS0HJ-ssIFsZk,61
|
|
129
|
+
mns_common-1.3.1.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
130
|
+
mns_common-1.3.1.3.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
|
|
131
|
+
mns_common-1.3.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|