--
You received this message because you are subscribed to the Google Groups "pvlib-python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pvlib-python...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pvlib-python/4f3f68b0-4c3d-4624-9c20-55c72b39d9f6n%40googlegroups.com.
Hi Lorenzo,
Everything in Python is an object, and it is up to each of them how to implement arithmetic operations.
If you run [1, 2, 3] * 1.5 you will get the same error. This is because a list (the first item) doesn't implement multiplication by non ints (the second item is a float). If you multiply by an int you will get another type of result: you can try running [1,2,3]*2 on the python console and checking the output.
Now, what you have to do is exactly what you expect: you need an object that defines the element-wise multiplication. For this kind of use, we usually either use numpy.ndarray or pandas.Series objects (there are other alternatives too).
Possibilities to convert a Python list into an array are:
I heavily recommend you check out their docs, reading documentation in Python is a key part in the development.
I don't really know where are you getting the data from, but pandas has an extensive API of readers: CSV files, JSON, ... Just in case it can help you.
/Echedey.