0

How can I use Pandas in a derived class of EnergyPlusPlugin

I import pandas on top of my .py file, and run the simulation. The error says that 'No module named pandas'.

S.Wang's avatar
131
S.Wang
asked 2022-03-01 07:54:27 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2022-03-01 09:29:39 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

3

Problem solved.

The directory of Pandas needs to be added to the search path object in the IDF file.

Otherwise, energy-plus won't know where to find it.

S.Wang's avatar
131
S.Wang
answered 2022-03-02 04:10:20 -0500
edit flag offensive 0 remove flag delete link

Comments

This helps a lot.

Fan's avatar Fan (2022-06-10 07:49:36 -0500) edit
add a comment see more comments
1

Python comes with a number of built in packages such as "datetime" and "csv"

If you do:

import datetime
import csv

it will work with no issues.

Pandas is not a built-in python package. This means that you need to install it. Generally you can install it with:

pip install pandas

Read more on pandas installation at https://pandas.pydata.org/pandas-docs...

Once pandas is is installed your code should work.

if you are starting to install external packages, you may want to read about virtualenv https://docs.python.org/3/library/ven...

santoshphilip's avatar
961
santoshphilip
answered 2022-03-01 12:54:34 -0500, updated 2022-03-01 12:55:59 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you very much!

I actually have installed pandas and have managed to use it in some other python scripts.

But in the plug-in instance I wrote, energyplus cannot find it.

S.Wang's avatar S.Wang (2022-03-02 03:22:29 -0500) edit
add a comment see more comments