On 05/03/2026 19:43, Sven Schreiber wrote:
Am 05.03.2026 um 18:52 schrieb Riccardo (Jack) Lucchetti:
>
> Hi all,
>
> I noticed that the "--send-data" option for the python variant of the
> "foreign" command didn't actually do anything.
>
Maybe there could be an error message, but --send-data as per the
documentation is only intended "with R, Octave and Stata". But I guess
what you mean is to change that status quo.
Yes. And besides, the --send-data
option in the python case didn't
produce an error, either.
> note: I used pandas' read_csv() method, which means that this
won't
> work if you haven't got pandas installed.
>
Is pandas really necessary? Currently gretl uses numpy.loadtxt for the
pre-defined gretl_loadmat function. Or to put it differently: if a
pandas dataframe is used, then its extra functionality should be used,
I think. (Like time period information and so on, I'm not really an
expert on pandas internals.)
Of course it isn't necessary, and in fact pandas won't be loaded unless
you use the --send-data option. I was acting under the assumption that,
if you want to pass some data, you'd probably want to do so in the
de-facto standard format in the python world, that is as a pandas
dataframe. That said, I agree, it would be nice to pass as much metadata
as possible. For example, we could use the to_datetime() method
automatically if the incoming dataset is time-series, although maybe
this is something that a Python-savvy user might want to do manually in
some cases.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------