On Thu, 16 Sep 2021, 03:25 george trojan, <george.tro...@gmail.com> wrote:

>
> I just wrote the following code:
>
> twb = scipy.optimize.fsolve(phi, tdb, args=(tdb, p, w, hd_tdb, hg_tdb),
> xtol=1e-8)
> tdb, p, w, hd_tdb, hg_tdb
> twb.shape
> print("wet-bulb temperature {:.5f} [deg K]".format(float(twb)))
>
> The output is
>
> (313.15, 101325.0, 0.009200033532084696, 40182.343155896095, 
> 2573510.322137241)
>
> (1,)
>
> wet-bulb temperature 295.17583 [deg K]
>
> All arguments are floats, the function phi returns float as well. I did
> expect the output to be float. Instead I got a 1d array. Were my
> expectations wrong?
>

In the return section for fsolve the documentation states that the return
value, `x`, is an `ndarray`.

>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to