This may not be a big problem, I just haven't noticed this output of None
before when doing .apply()
Toy example:
mydf = pd.DataFrame({'col1':['test1',np.nan,'test3','test4'],
'col2':['test5','test6','test7','test8']})
mydf
col1 col2
0 test1 test5
1 NaN test6
2 test3 test7
3 test4 test8
Function to just add the values together in a string:
def myfunc(row):
thing = str(row['col1']) + str(row['col2'])
print(thing)
Applying it:
mydf.apply(myfunc,axis=1)
My output:
test1test5
nantest6
test3test7
test4test8
0 None
1 None
2 None
3 None
dtype: object
Is it something to be worried about? I will be applying something like this to some real data shortly. I am doing this in Jupyter Notebook if it makes a difference.