Select to view content in your preferred language

Conversion between Python and Arcade

961
6
Jump to solution
12-12-2023 02:51 AM
Labels (3)
HusamJubeh
Emerging Contributor

Conversion between Python and Arcade
I can write an expression in Python to get new data in a specific order through the expression ( !BQCODE![3:5] ) but I do not know how to write that expression in the Arcade language.
Is there anyone who can help?
Gratefully

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
MicZatorsky_AEC
Frequent Contributor

In the Calculate Field tool, the Arcade expression 

Mid($feature.BQCODE, 3, 2)

is the equivalent of the Python expression

!BQCODE![3:5]

 Python uses a start index and an end index.  Arcade uses the start index and the number of characters.

View solution in original post

6 Replies
DanPatterson
MVP Esteemed Contributor

Function Reference | ArcGIS Arcade | ArcGIS Developers

may be of use.. perhaps the Text portion


... sort of retired...
0 Kudos
HusamJubeh
Emerging Contributor

Thank you 
But I want to get to the expression quickly. I searched for it but did not find it.
Can you write the expression here??
Gratefully

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

It helps to provide information about data types and an example or two.

0 Kudos
HusamJubeh
Emerging Contributor

correct
but I cannot reach the correct expression in Arcade, but in Python I know it

can you help me ؟

Gratefully

0 Kudos
MicZatorsky_AEC
Frequent Contributor

In the Calculate Field tool, the Arcade expression 

Mid($feature.BQCODE, 3, 2)

is the equivalent of the Python expression

!BQCODE![3:5]

 Python uses a start index and an end index.  Arcade uses the start index and the number of characters.

HusamJubeh
Emerging Contributor

Thank you 😍

0 Kudos