7cbf66006434c859e4ba7f0d4de816fce1532d72,QUANTAXIS/QAData/base_datastruct.py,_quotation_base,get_bar,#_quotation_base#Any#Any#Any#,782
Before Change
def get_bar(self, code, time, if_trade=True):
if self.type[-3:] in ["day"]:
return self.new(self.query("code=="{}" & date=="{}"".format(code, str(time)[0:10])).set_index(["date", "code"], drop=False), self.type, self.if_fq)
elif self.type[-3:] in ["min"]:
return self.new(self.query("code=="{}"".format(code))[self.data["datetime"] == str(time)].set_index(["datetime", "code"], drop=False), self.type, self.if_fq)
After Change
return self.new(self.data.loc[pd.Timestamp(time), code], self.type, self.if_fq)
except:
raise ValueError(
"DATASTRUCT CURRENTLY CANNOT FIND THIS BAR WITH {} {}".format(code, time))
def find_bar(self, code, time):
if len(time) == 10:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 2
Instances
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 7cbf66006434c859e4ba7f0d4de816fce1532d72
Time: 2018-06-01
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/base_datastruct.py
Class Name: _quotation_base
Method Name: get_bar
Project Name: Pinafore/qb
Commit Name: df1dd9b108f3cd7d5130e7f654ea099021c7a2b3
Time: 2017-05-24
Author: ski.rodriguez@gmail.com
File Name: qanta/guesser/experimental/elasticsearch_instance_of.py
Class Name: ElasticSearchIndex
Method Name: search
Project Name: HazyResearch/fonduer
Commit Name: b9dc15ecef0393a55a953acff3c1d0278b19d9f5
Time: 2018-09-01
Author: lwhsiao@stanford.edu
File Name: src/fonduer/candidates/candidates.py
Class Name: CandidateExtractor
Method Name: clear