How to get values from all the columns of the table in Spotfire using IronPython

Jacek Sierajewski

I found an IronPython code to retrieve all the data for particular column or for multiple columns (explicitly defined) but I need to iterate tru all the data in an analysis and I wish to use a code that could let me do that without defining all the columns but to just handle all the rows of all tables.

EDIT: It seems I must clarify. There is a method of a table object: https://docs.tibco.com/pub/doc_remote/sfire-analyst/7.7.0/TIB_sfire-analyst_7.7.0_api/html/M_Spotfire_Dxp_Data_DataTable_GetRows.htm

DataTable. GetRows Method (DataValueCursor[] )

and what I need is to be able to pass a 'list/array/whatever' of cursors without knowing in advance how many columns each of the tables has.

Monte_fisto

You can traverse all tables, rows and columns using the code below.

from Spotfire.Dxp.Data import *
for eDataTable in Document.Data.Tables:
    for eColumn in eDataTable.Columns:
        for eTableRows in range(0,eDataTable.RowCount):
            print "Table: " + eDataTable.Name + "\tColumn: " + eColumn.Name +"\tRow: " + str(eTableRows) + "\tValue: " +eDataTable.Columns[eColumn.Name].RowValues.GetFormattedValue(eTableRows)

EDIT

Its a little cumbersome, but it looks like you can pass an array of cursors... something like this, which prints a table structure

from Spotfire.Dxp.Data import *
from System.Collections.Generic import List
import System
from System import Array
for eTable in Document.Data.Tables:
    print "~~~~~~~~~~ " +eTable.Name+" ~~~~~~~~~~\n",
    CursList=[]
    ColList=[]
    for eColumn in eTable.Columns:
        CursList.append(DataValueCursor.Create(eTable.Columns[eColumn.Name]))
        ColList.append(eTable.Columns[eColumn.Name])
    CursArray = Array[DataValueCursor](CursList)
    for cName in range(ColList.Count):
        print str(ColList[cName])+"\t",
    print "\n",
    for row in eTable.GetRows(CursArray):
        for curs in range(CursList.Count):
            print str(CursList[curs].CurrentValue) + "\t",
        print "\n",

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How can i get a count(*) of all the columns in a table? Using PostgreSql

分類Dev

How can I use IronPython to save an analysis which I have modified using the Spotfire Consumer back to the library?

分類Dev

Get all columns from an SQL Table without Computed Columns

分類Dev

SQLAlchemy: How to get result in a list while querying single columns of table using all()?

分類Dev

How to get all distinct words of a specified minimum length from multiple columns in a MySQL table?

分類Dev

How to get data from columns of a table in HTML

分類Dev

How to get data from columns of a table in HTML

分類Dev

How to create a pivot table using row values as columns?

分類Dev

How to update multiple columns based on values from an associated table?

分類Dev

After using groupby, how do I get all values from multiple rows into a list?

分類Dev

UPDATE 2 columns of a table of values from a table

分類Dev

how to take all values from sql table column on condition?

分類Dev

using Case get values from different table in sql server

分類Dev

R data table unique record count based on all combination of a given list of values from 2 columns

分類Dev

Python: How to get all default values from argparse

分類Dev

How to get all keys with values from nested objects

分類Dev

How to get all the keys values from Redis Cache in C#?

分類Dev

How to get specific values from all UserID (UID) and save in RecyclerViewFirebaseUI

分類Dev

C#: how to get all values for keys from JS Object?

分類Dev

Get values from beginning of file, Insert values as new columns, trim beginning lines using AWK/GAWK/SED

分類Dev

How to get data by using different column values refrencing same table

分類Dev

How to get the values of a column from a table in jQuery into a multidimentional array

分類Dev

Spread values from one column into multiple new columns using data.table

分類Dev

how to get SUM of a set of values from a table then the MAX of those values and echo the 5 highest values

分類Dev

How to count records from multiple columns eliminating null values in hive table

分類Dev

Get columns of the columns table

分類Dev

how to get values from xml file then print them using php

分類Dev

How to get all trigger names from a database using Java JDBC?

分類Dev

How to get all data from MySQL with apostrophe in it using PHP

Related 関連記事

  1. 1

    How can i get a count(*) of all the columns in a table? Using PostgreSql

  2. 2

    How can I use IronPython to save an analysis which I have modified using the Spotfire Consumer back to the library?

  3. 3

    Get all columns from an SQL Table without Computed Columns

  4. 4

    SQLAlchemy: How to get result in a list while querying single columns of table using all()?

  5. 5

    How to get all distinct words of a specified minimum length from multiple columns in a MySQL table?

  6. 6

    How to get data from columns of a table in HTML

  7. 7

    How to get data from columns of a table in HTML

  8. 8

    How to create a pivot table using row values as columns?

  9. 9

    How to update multiple columns based on values from an associated table?

  10. 10

    After using groupby, how do I get all values from multiple rows into a list?

  11. 11

    UPDATE 2 columns of a table of values from a table

  12. 12

    how to take all values from sql table column on condition?

  13. 13

    using Case get values from different table in sql server

  14. 14

    R data table unique record count based on all combination of a given list of values from 2 columns

  15. 15

    Python: How to get all default values from argparse

  16. 16

    How to get all keys with values from nested objects

  17. 17

    How to get all the keys values from Redis Cache in C#?

  18. 18

    How to get specific values from all UserID (UID) and save in RecyclerViewFirebaseUI

  19. 19

    C#: how to get all values for keys from JS Object?

  20. 20

    Get values from beginning of file, Insert values as new columns, trim beginning lines using AWK/GAWK/SED

  21. 21

    How to get data by using different column values refrencing same table

  22. 22

    How to get the values of a column from a table in jQuery into a multidimentional array

  23. 23

    Spread values from one column into multiple new columns using data.table

  24. 24

    how to get SUM of a set of values from a table then the MAX of those values and echo the 5 highest values

  25. 25

    How to count records from multiple columns eliminating null values in hive table

  26. 26

    Get columns of the columns table

  27. 27

    how to get values from xml file then print them using php

  28. 28

    How to get all trigger names from a database using Java JDBC?

  29. 29

    How to get all data from MySQL with apostrophe in it using PHP

ホットタグ

アーカイブ