Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Examples/Basic/tutorial1.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def main():
ldf_data = c_dataobj.get_data(ldt_timestamps, ls_symbols, ls_keys)
d_data = dict(zip(ls_keys, ldf_data))

# Filling the data for NAN
for s_key in ls_keys:
d_data[s_key] = d_data[s_key].fillna(method='ffill')
d_data[s_key] = d_data[s_key].fillna(method='bfill')
d_data[s_key] = d_data[s_key].fillna(1.0)

# Getting the numpy ndarray of close prices.
na_price = d_data['close'].values

Expand Down
1 change: 1 addition & 0 deletions Examples/Basic/tutorial3.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def main():
# Filling the data.
df_rets = df_rets.fillna(method='ffill')
df_rets = df_rets.fillna(method='bfill')
df_rets = df_rets.fillna(1.0)

# Numpy matrix of filled data values
na_rets = df_rets.values
Expand Down
3 changes: 3 additions & 0 deletions Examples/Basic/tutorial5.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def main():

# Reading just the close prices
df_close = c_dataobj.get_data(ldt_timestamps, ls_symbols, "close")
df_close = df_close.fillna(method='ffill')
df_close = df_close.fillna(method='bfill')
df_close = df_close.fillna(1.0)

# Creating the allocation dataframe
# We offset the time for the simulator to have atleast one
Expand Down