mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-16 01:06:56 +08:00
Fix read_bin bug
This commit is contained in:
@@ -44,7 +44,7 @@ def read_bin(file_path, start_index, end_index):
|
|||||||
ref_start_index = int(np.frombuffer(f.read(4), dtype="<f")[0])
|
ref_start_index = int(np.frombuffer(f.read(4), dtype="<f")[0])
|
||||||
si = max(ref_start_index, start_index)
|
si = max(ref_start_index, start_index)
|
||||||
if si > end_index:
|
if si > end_index:
|
||||||
return pd.Series(np.float32)
|
return pd.Series(dtype=np.float32)
|
||||||
# calculate offset
|
# calculate offset
|
||||||
f.seek(4 * (si - ref_start_index) + 4)
|
f.seek(4 * (si - ref_start_index) + 4)
|
||||||
# read nbytes
|
# read nbytes
|
||||||
|
|||||||
Reference in New Issue
Block a user