Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

from import from python in reticulate

Tags:

r

reticulate

Any way to do the from - import from Python in Reticulate without having to import the whole module?

example: from tensorflow import keras

I know about the solution below, but it imports the whole module anyway...

keras <- import('tensorflow')$keras
like image 918
daniellga Avatar asked Oct 26 '25 07:10

daniellga


1 Answers

keras <- import('tensorflow.keras')

In general in python:

from abc import xyz as uvw

means in R

uvw <- import('abc.xyz')
like image 178
Indranil Gayen Avatar answered Oct 28 '25 21:10

Indranil Gayen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!