HPa
2018-11-15 16:58:59 UTC
import pandas
import statsmodels.formula.api as smf
df = pandas.DataFrame([
{'Y': 1, 'A' : 2, 'B' : 3},
{'Y': 4, 'A' : 5, 'B' : 6}])
mod = smf.quantreg('Y ~ A + B', data=df)
res = mod.fit(q=0.5) # The error message comes from here
Gives me error message:
ValueError: operands could not be broadcast together with shapes (3,) (2,)
If I remove A or B, then I dont get the error.
Same error in my PC, and in Azure Notebooks.
I cannot see what is the problem, anybody can help?
import statsmodels.formula.api as smf
df = pandas.DataFrame([
{'Y': 1, 'A' : 2, 'B' : 3},
{'Y': 4, 'A' : 5, 'B' : 6}])
mod = smf.quantreg('Y ~ A + B', data=df)
res = mod.fit(q=0.5) # The error message comes from here
Gives me error message:
ValueError: operands could not be broadcast together with shapes (3,) (2,)
If I remove A or B, then I dont get the error.
Same error in my PC, and in Azure Notebooks.
I cannot see what is the problem, anybody can help?