In base a ciò è la tabella dei dati riportata di seguito:
| | Riga | UN | B | C | D |
| 1 | UN | 1 | 0.02 | 0.8 | -0,6 |
| 2 | B | 0.02 | 1 | 0.7 | -0,02 |
| 3 | C | 0.8 | 0.7 | 1 | 0,51 |
| 4 | D | -0,6 | -0,02 | 0,51 | 1 |
Dovrei creare un'altra tabella di dati che fornisca quanto segue: riga corrispondente, colonna corrispondente come indicato nella colonna 1 e il suo valore. Posso chiedere se devo creare una matrice o semplicemente devo modificare dalla tabella dei dati? Ogni aiuto è apprezzato, grazie. (Di seguito è riportato un risultato della prima tabella di dati sopra, tranne per il fatto che ora devo farlo per oltre 2.000 righe.)
| | Righe corrispondenti | Colonne corrispondenti | >=0,05 && < 1 |
| 1 | UN | C | 0.8 |
| 2 | B | C | 0.7 |
| 3 | C | UN | 0.8 |
| 4 | C | B | 0,51 |
| 5 | C | D | 0,51 |
| 6 | D | C | 0,51 |
Costruire su @ron_horne esempio, ecco un pezzo di codice completo che funzionerà sulla tabella di dati di esempio o sulla tabella di dati 2000x2000 che hai citato
dt = current data table ();
cols = dt << Get Column Names( Continuous );
dtStack = dt << Stack(
columns( cols ),
Source Label Column( "Coresponding Columns" ),
Stacked Data Column( ">=0.05&&<1" )
);
dtStack:Row << set name("Corresponding Rows");
dtStack << select where( dtStack:Name(">=0.05&&<1") < .05 | dtStack:Name(">=0.05&&<1")>=1);
dtStack << delete rows;
Ciao @reallyneedhelp ,
fammi sapere se i seguenti script ti avvicinano al tuo obiettivo.
dt = current data table ();
cols = dt << Get Column Names( Continuous );
dt << Stack(
columns( cols ),
Source Label Column( "Column" ),
Stacked Data Column( "Data" )
);
Ron
Ciao @reallyneedhelp ,
forse questa rapida opzione Stack farà il lavoro.
vai su Tabelle>>impila. da lì puoi seguire le immagini


puoi anche seguire questo script. una volta che hai la tabella, esegui lo script "Stack" dal lato in alto a sinistra.
New Table( "Untitled",
Add Rows( 4 ),
New Script(
"Stack",
Data Table( "Untitled" ) << Stack(
columns( :A, :B, :C, :D</img> ),
Source Label Column( "Column" ),
Stacked Data Column( "Data" )
)
),
New Column( "Row", Character, Nominal, Set Values( {"A", "B", "C", "D"} ) ),
New Column( "A",
Numeric,
Continuous,
Format( "Best", 12 ),
Set Values( [1, 0.02, 0.8, -0.6] )
),
New Column( "B",
Numeric,
Continuous,
Format( "Best", 12 ),
Set Values( [0.02, 1, 0.7, -0.02] )
),
New Column( "C",
Numeric,
Continuous,
Format( "Best", 12 ),
Set Values( [0.8, 0.7, 1, 0.51] )
),
New Column( "D",
Numeric,
Continuous,
Format( "Best", 12 ),
Set Values( [-0.6, -0.02, 0.51, 1] )
)
)
facci sapere se questo è quello che stai cercando.
Ron