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
Conducting Attribute Testing with Data Analysis Software
Oct 18 Question:   As an internal auditor, we are approached on a regular basis by software providers offering products that do not appear to have real differ...
No Image
Sep 19 Henry Ford once said that if he had asked people what they wanted, they would have said faster horses. Constant innovation keeps businesses thriving. Ford Motor...
New Perspectives (AHIA) Article on Data Analysis Challenges
Apr 19   Executive Summary   When it comes to using data analysis in place of manual audit processes, the benefits clearly outweigh the challenges. From...
BROWSER NOT SUPPORTED

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

×