i()

Here are how to use i() functions.

A.i()

Description:

Convert a specified sequence to a pure sequence.

Syntax:

A.i()

Note:

The function converts sequence A to a pure sequence. A pure sequence is a sequence where members have same data type.

 

The conversion is impossible when members of the sequence do not have same data type. Error is reported when members are modified and a pure sequence becomes not pure. When the computation involves an ordinary sequence or when it is expected that the result of the computation is not a pure sequence, the specified sequence will be automatically converted to an ordinary one.

Parameter:

A

A sequence

Return value:

A pure sequence

Example:

 

A

 

1

=["a","c","d","e","f"]

 

2

=A1.i()

Convert sequence A1 to a pure sequence.

3

=[1,2,3,4,5,6,7,"a"]

 

4

=A3.i()

As members of A3’s sequence don’t have same data type, error is reported when trying to convert it to a pure sequence.

5

=A2(3)=8

Error is reported during execution of the expression because we change the 3d member in A2 to 8 and the originally pure sequence becomes not pure.

P.i()

Description:

Convert a specified table sequence to a pure table sequence.

Syntax:

P.i()

Note:

The function converts table sequence P to a pure record sequence or a pure table sequence that uses columnwise storage. A pure table sequence is a table sequence where all fields are made pure.

Error is reported when field values of a pure table sequence are modified.

Parameter:

P

A table sequence

Return value:

A pure record sequence or a pure table sequence

Example:

 

A

 

1

=demo.query("select EID,NAME,GENDER,DEPT,BIRTHDAY from employee")

Return a table sequence whose all fields are pure fields.

2

=A1.i()

Convert A1’s table sequence to a pure table sequence.