INNER CODE UNIT · Python
nan_count
ScottfreeLLC/AlphaPy · alphapy/analysis.py:241
nan_count = df[target].isnull().sum()
forecast_check = forecast_period - 1
if nan_count != forecast_check:
logger.info("%s has %d records with NaN targets", tag, nan_count)
# drop records with NaN values in target column
new_test = new_test.dropna(subset=[target])
# append selected records to the test frame
test_frame = test_frame.append(new_test)
else:
logger.info("Testing frame %s has zero rows. Check prediction date.",
tag)
else:
logger.info("Training frame %s has zero rows. Check data source.", tag)
# Write out the frames for input into the AlphaPy pipeline
directory = SSEP.join([directory, 'input'])
if predict_mode: