Modify data.add_const() to support ndarray as well as DataFrame