gridstudio first test example

With practical problems tried it, I feel that the benefits of convenience and python interactive excel, excel extends the processing power.

 

# From a table in accordance with the unique value in a column corresponding to all the values of isolated another column, lateral display. The vlookup excel only detect a value. 
# Do hardware statistics before when done with a very complex excel formula. 

# Enter Test Data 
Sheet ( " A1: A6 " , [ ' SYS1 ' , ' SYS1 ' , ' SYS1 ' , ' SYS2 ' , ' SYS2 ' ]) 
Sheet ( " Bl: B6 " , [ ' CPU 4 ' , ' mem128 ' , ' DB2 ' , ', ' Oracle ' ]) 

# obtain data 
DF = Sheet ( " A1: B5 " )
 Print (DF) 

# Get the unique values in column A as a search term, on the D column 
index = DF [0] .unique () 
Sheet ( " D " , index)
 # Print (DF [0] .value_counts ()) 

# based on the search terms, to identify the corresponding values in the right column E and 
# C is a line labeled 
C =. 1 for I in index: 
    Result DF = [DF [0] == I] [. 1 ] 
    R & lt = List (Result) 
    START_CELL = " E " +
STR (C)
     # the ord ascii value acquisition, acquires the character CHR reverse control column index. 
    = CHR END_CELL (the ord ( " E " ) + len (R & lt)) + STR (C) 
    CELL_RANGE = START_CELL + " : " + END_CELL
     # written 
    Sheet (CELL_RANGE, R & lt) 
    C = C +. 1 Print ( " DONE " )
    

 

Guess you like

Origin www.cnblogs.com/arsh/p/11418176.html