First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

To get the max value in row with excelpy

asked Aug 8 '3

Jimmy gravatar image

updated Aug 8 '3

My goal :To get the max value in row with excelpy

My thought : Is it possible to read the results in excel then I can do the max(row 3) 、max(row 4) ?

Is there any solution?

Thank you so much for reading my question.

My Code:

                   .
                   .

ierr,buses = psspy.abusint(1,1,string='NUMBER')

ierr,volts = psspy.abusreal(1,1,string='PU')

x1.set_range(2,'b',zip(*buses),True)

x1.set_range(3,'b',zip(*volts),True)
                   .
                   .
                   .
for  x in range(len( bus number))

z=x+4
                   .
                   .
                   .

ierr,volts_1 = psspy.abusreal(1,1,string='PU') 

x1.set_range(z,'b',zip(*volts_1),True)

del z

Result in Excel:

       a    b    c    d    e    f    g    h       i   
1

2     1     2    3    4    5    6    7    8              (buses number)

3    10     5   30   85    50   60   75   80     (85)    (volts)  (max value in row 3 is 85)

4    90    60   20   10    5    6    8    12     (90)    (volts)  (max value in row 4 is 90)

5    6     10  ..............................            (volts)

6   .........................................            (volts)

1 answer

Sort by » oldest newest most voted
1

answered Aug 8 '3

perolofl gravatar image

I'm not sure what you mean, but you can write the max value for line 3 with:

x1.set_cell((3,2+len(volts[0])),max(volts[0]))

The value will be written after the last column.

link

Comments

Thank you for giving me this idea. I solve the problem. Thanks

Jimmy gravatar imageJimmy (Aug 9 '3)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Aug 8 '3

Seen: 165 times

Last updated: Aug 08 '23