I have a recursive function
def boost_test(frame, iteration, max_iteration):
if iteration < max_iteration:
print iteration, max_iteration
# get predictions
iteration += 1
boost_test(frame, iteration, max_iteration)
elif iteration == max_iteration:
print 'return frame', iteration, max_iteration, frame.columns
#print frame
return frame
I can run it like this:
testF = pd.DataFrame([1,2])
testF.columns = ['hello']
n = boost_test(testF, 0, 5)
Here is the output: 0 5 1 5 2 5 3 5 4 5 return frame 5 5 Index([u'hello'], dtype='object')
So, it looks like everything is correct. But if it doesn't look like the function is actually returning a frame.
When I try n.head()
I get:
AttributeError: 'NoneType' object has no attribute 'head'
I'm at a loss for why it isn't returning the dataframe. Any help is much appreciated. Thanks!