Transfer InfluxDB data to/from python

Hi,

We have to get last N values of temperature measurement and pass it to python for use in ML algorithm. Also we have to get result back from Python and update it in influxdb for indicating predictive maintenance values.

What is the right way to pass data from TICK script to Python and Vice Versa?

Thanks,
Manu