Audimation Services has been acquired by CaseWare International Learn More.

X
Icon


Blog Image

Give Python a Go


Python is considered the official programming language for non-programmers. It gives you increased flexibility and expansive access to your data. For those using IDEA 10.3 or higher, you can leverage the power of Python to build your own advanced analytics or use existing Python scripts to identify outliers within both numeric and character fields.

Let’s get started with a few tips to ease you into this new user-friendly programming language:

 

Comments

 

Python uses the # to write comments. Comments do not interfere with your instructions; they are simply notes for you and anyone interacting with your code.

# This is an example of a comment. For example, I can use this to explain how a complex equation works.

 

Declaring, Assigning, and Accessing Variables

 

Python is classified as a weakly typed language. Variables are not required to declare their datatypes nor do functions force parameters to be a certain type. It’s also a dynamic language, meaning variables do not need to be declared and all types are inferred at assignment.

 

Text

 

Text data is very simple to work with in Python. It may be interacted with directly without the requirement of first saving the value to a variable. Text values may be declared with either quotes or apostrophes. This simplifies the inclusion of quotes and apostrophes inside of your data without needing to use an escape sequence.

# As shown here, digits did not declare a type. It immediately took a value.

digits = "1234567890"

# If you’d like to isolate only the even numbers, for example, you may do so with the # variable or data directly.

digits[1::2]

"1234567890"[1::2]

 

Numbers

 

Python handles numbers for you in the background. It essentially supports two types of numbers: Integers and floating point values. However, you don’t need to worry about telling it what kind of numbers you have due to its type inference.

whole_number = 10

floating_point = 3.1415

 

Boolean Values

 

Boolean values are logical outcomes of either true or false. They are used in all sorts of ways, but most commonly is control flow statements like the if statement. To declare one, true or false must be capitalized in Python.

passed_test = True

 

Lists

 

Lists are more or less what they sound like. They are collections of data organized into a linear list. True to Python’s weakly typed nature, lists can hold any combination of datatypes (contrary to compiled languages). They are useful for keeping related pieces of information together and be accessed with an index value. This is an example of their syntax:

bundle_of_data = ["text", 5, True, 2.1]

bundle_of_data[0]

 

Slicing

 

In Python, slicing is how elements are retrieved from lists using a precise pattern. Indexing only retrieves a single value. Slicing, as seen in the even digits example, returns another list of data depending on the pattern given to it. The pattern follows this form: [starting point : ending point : counting by].

Ready to learn more about Python? Refer to these past Tech Tips for a deeper dive:

Exploring IDEA's Built-in Power of Python

Infusing Python into Your Analysis with IDEA


Best Practices , Data Analytics , Tech Tip



Posted By

By Audimation Team


Related Posts
Tech Issues: Data Analytics Locks in Relevance
Nov 11 As a CPA, you’ve always been the one who can pick the relevant data out of an array of long columns and rows. These days, however, the amount of data collecte...
Reusing Import Templates
Jan 12 Report Reader is a powerful tool for bringing PDF or print reports into IDEA. However importing the same report month after month can get time consuming and ted...
Importing QuickBooks Data into IDEA
Jan 22 QuickBooks is an essential part of everyday business for small- and medium-sized businesses. With limited full-time employees (FTEs), record keepers and signers...
BROWSER NOT SUPPORTED

This website has been designed for modern browsers. Please update. Update my browser now

×