cvxportfolio
cvxportfolio copied to clipboard
null_checker requires extra np.any()
I'm wondering if it's perhaps a result of new pandas behaviour, but I had to change the null_checker (line 29 in data_management.py) to read as:
if np.any( np.any(np.any(pd.isnull(obj))) ):
for the HelloWorld example to run. Seems to be an issue in that it spits out a series of "False" values and it requires a single bool value. Can anyone confirm? I'm on Pandas 0.20.3.
I had same issue. You are right. It is because pandas behavior changed with newer version
Sent from my iPhone
On Oct 6, 2019, at 1:43 PM, thayes75 [email protected] wrote:
I'm wondering if it's perhaps a result of new pandas behaviour, but I had to change the null_checker (line 29 in data_management.py) to read as:
if np.any( np.any(np.any(pd.isnull(obj))) ):
for the HelloWorld example to run. Seems to be an issue in that it spits out a series of "False" values and it requires a single bool value. Can anyone confirm? I'm on Pandas 0.20.3.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
If that is the case, you should probably use np.any(pd.isnull(obj).values.reshape(1,-1))
so that the code doesn't assume the object is a pd.Panel
. Apparently you can also use obj.isnull().any(axis=None)
which works with Series, Dataframes, and Panels.
null checker still has the above issue with 0.0.12.