[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HELP: Reading table from CSV
From: |
Heinrich Schuchardt |
Subject: |
Re: HELP: Reading table from CSV |
Date: |
Sat, 5 Dec 2020 14:54:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 |
On 12/5/20 2:11 PM, Manuel Castro wrote:
Hi all,
First, I would like to thank you for the constant support as you have
always addressed my questions very promptly.
Second, I would like to ask you a question as I am really stuck on this one.
I have defined the following in the code:
set LoadsCount;
set PeriodsCount;
param LoadPowerProfile{i in LoadsCount, j in PeriodsCount};
For the sake of discussion let's assume that "LoadsCount" is 1..100 and
"PeriodsCount" is 1..8760 (i.e. hourly values through the year).
I now want to fill in my array "LoadPowerProfile" with values. For that
I have the following table in CSV (of course this is a stylized table
just for you to understand what I am up to).
With the GLPK you cannot read cross-tabulated CSV files.
You should create a table where you have separate columns for load,
hour, value.
Load,Hour,Value
1,0,3.4
1,1,5.7
...
100,8760,6.7
Best regards
Heinrich
Load
1
2
(…)
8760
Load1
11.98
62.51
99.69
Load2
86.39
59.50
25.89
(...)
Load100
67.98
98.71
31.19
How do I read the yellow shaded area into my "LoadPowerProfile" array? I
would be thankful if you could give me an example of the statement i
should use to read this into "LoadPowerProfile" array.
Many thanks in advance for all your support.
Kind regards,
Manuel.