dd13edfd8e2f10fe43499d89bf6abc875fbafd7b,QUANTAXIS/QASU/save_local.py,,QA_SU_save_financial_files,#,36
Before Change
def QA_SU_save_financial_files():
本地存储financialdata
filename=download_financialzip()
if len(filename)>0:
for item in filename:
print("NOW SAVING {}".format(item))
data = QA_util_to_json_from_pandas(parse_filelist([item]).reset_index(
).drop_duplicates(subset=["code", "report_date"]).sort_index())
coll = DATABASE.financial
coll.create_index(
[("code", ASCENDING), ("report_date", ASCENDING)], unique=True)
try:
coll.insert_many(data, ordered=False)
except Exception as e:
if isinstance(e,MemoryError):
coll.insert_many(data, ordered=True)
elif isinstance(e,pymongo.bulk.BulkWriteError):
pass
else:
print("SUCCESSFULLY SAVE/UPDATE FINANCIAL DATA")
After Change
[("code", ASCENDING), ("report_date", ASCENDING)], unique=True)
for item in os.listdir(download_path):
date=int(item.split(".")[0][-8:])
print("QUANTAXIS NOW SAVING {}".format(date))
if coll.find({"report_date":date}).count()<100:
print(coll.find({"report_date":date}).count())
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: QUANTAXIS/QUANTAXIS
Commit Name: dd13edfd8e2f10fe43499d89bf6abc875fbafd7b
Time: 2018-06-17
Author: yutiansut@qq.com
File Name: QUANTAXIS/QASU/save_local.py
Class Name:
Method Name: QA_SU_save_financial_files
Project Name: pytorch/audio
Commit Name: 38d1a9b6325d8b69e9b26ce28b1f1a8e0040c51b
Time: 2019-11-06
Author: vincentqb@users.noreply.github.com
File Name: torchaudio/datasets/librispeech.py
Class Name:
Method Name: load_librispeech_item
Project Name: bokeh/bokeh
Commit Name: 8451d9c3690f1d47adcb929771b4ce37ea2c3e0d
Time: 2017-09-01
Author: mattpap@gmail.com
File Name: bokeh/util/compiler.py
Class Name:
Method Name: _detect_nodejs