0

I am working on python libraries and their functions in R environment using reticulate package.

I am accessing these libraries using the following criteria

library('reticulate')
pvlib <- import('pvlib')

models say from pvlib library can be obtained this way:

GFS <- pvlib$forecast$GFS

wherever I want this model, I can call it using the variable name in which I have stored it.

Now the problem lies in calling different function from libraries (for example pvlib).

I believe I can do it using the below mentioned way.

sandia_modules <- pvlib$pvsystem$retrieve_sam('sandiamod')

this approach isn't working for me. I am not sure how I can do it correctly. If anyone guide me to the correct approach will appreciate.

Regards

Julien
  • 13,986
  • 5
  • 29
  • 53
Jaws
  • 65
  • 2
  • 8
  • why is there a python tag? – Julien May 01 '18 at 06:44
  • because python and r users work with this sort of integration. – Jaws May 01 '18 at 06:45
  • but if this question is in R, python only users (like myself) have nothing to say... – Julien May 01 '18 at 06:47
  • understand. Will take care now – Jaws May 01 '18 at 06:48
  • Your code works for me (installed via `pvlib` via `pip`). What error messages are you getting? – Yuan Tang May 02 '18 at 16:52
  • @YuanTang I am getting error when I run `sandia_modules <- pvlib$pvsystem$retrieve_sam('sandiamod')` is that working well for you? Error is : Error in `row.names<-.data.frame`(`*tmp*`, value = value) : invalid 'row.names' length` and when I am running it's equivalent in python i.e `sandia_modules = pvlib.pvsystem.retrieve_sam('sandiamod') ` it is working perfect. I am not sure why is it so – Jaws May 03 '18 at 04:16
  • i just removed the package and installed again. It's working now. What stupid issue was it. I wasted so much time on this – Jaws May 03 '18 at 05:55
  • @YuanTang this line of code worked. But now when I am running with other inputs like `cec_inverters = pvlib$pvsystem$retrieve_sam('sandiainverter')` I am getting the error: Error in py_get_attr_impl(x, name, silent) : AttributeError: 'DataFrame' object has no attribute 'dtype' . Can you check if this working for you? and possibly what can be the issue now? – Jaws May 03 '18 at 08:31

0 Answers0