pd.dataframe interface in abstract model

18 views
Skip to first unread message

KRISHAN GOPAL SHARMA

unread,
Jul 13, 2021, 12:03:12 PM7/13/21
to Pyomo Forum
Hi All,
Greeting of the day,
I want to access the data(i.e some specific time series) as the model input 
I have Created a data frame in pandas.
Before that, I was accessing the data from dat file
data = DataPortal()
data.load(filename='pp1.dat')
But now I have a larger set of data
so I want to import data from CSV->pd. data frame->????(how to use pd.data frame in the abstract model)
Cheers!
Thanks

Regards,
Krish

David Woodruff

unread,
Jul 14, 2021, 5:40:33 PM7/14/21
to pyomo...@googlegroups.com
Hi Krish,
  Maybe someone has a better answer, but I don't think there is any way to load all data for a complicated AbstractModel model from one csv file using data portals the way you did using the dat file format. So one way or the other, you are going to have to do some programming. You can load individual components from csv files using DataPortal:

and you can do almost anything you want to do using the BuildAction component:

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/9b4bfc8a-16c2-460a-9188-8c4497011df4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages