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 do not 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 record sequence/table sequence to a pure record sequence/pure table sequence.

Syntax:

P.i()

Note:

The function converts record sequence or table sequence P to a pure record sequence or a pure table sequence. A pure table sequence is a table sequence where all fields are pure. A pure record sequence is a record sequence made up of records coming from same pure table sequence.

Error is reported when field values of a pure table sequence are modified. When the computation involves an ordinary record sequence or when it is expected that the result of the computation is not a pure record sequence, the specified record sequence will be automatically converted to an ordinary one.

Parameter:

P

A record sequence or 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 sequene to a pure table sequence

3

=A1.select(DEPT=="HR")

Return an ordinary record sequence

4

=A2.select(DEPT=="R&D")

Return a pure record sequence

5

=A3&A4

Combine A3’s ordinary sequence and A4’s pure record sequence and return an ordinary record sequence