Picalo python data analysis tutorial

What is data analysis?

Lets understand this term with an example.You want to invest in share market (equity).You can make money if you can predict growth of equity.Everyday equity market opens at certain mark and closes at certain mark.In between the period fluctuations in value occur.This occurs everyday.So if you write down daily opening and closing price of an equity for say five years you have considerable amount of data.

Now this data is not meaningful unless you can make some decisions and derivations from it.What is maximum value of stock in this period?What is minimum value of stock in this period? What is the mean value?

To answer questions like this you need to analyze the data and make conclusions.So data analysis is termed as process or tools used to analyze the data and come up with a trend and conclusion to help in decision making.

What is Picalo?

Picalo is an open source software. It is used for Data Analysis,Statistical analysis,trend analysis using a nice simple graphic user interface.Picalo is based on Python.Python is one of the preferred programming languages for data analysis.Having its root in Python makes Picalo a strong tool for data analysis and fraud detection.

Picalo is powerful and can handle large data volume.The amount of data which can be handled depends on your system memory.You can use power of Python to extend functionality.The tool itself gives you great number of functions to use.

You can import data from excel sheets and also export data to excel sheets.I had once worked on a piece using Picalo.The learning curve was easy and it is fun to work with.This tutorial gives you insight into power of Picalo and its various features.

Picalo installation

Picalo can be installed on any operating system (for example Linux distros like Fedora,OpenSUSE,Ubuntu,Mandriva,Centos etc,Solaris and Windows).The software dependencies required for Picalo installation is same for all above operating systems.The difference lies in commands to install these dependencies.The installation process of Picalo on Windows consist of below steps

  • Installing Python2.6
  • Installing wxPython2.8-unicode-py26
  • setuptools-0.6c11
  • chardet
  • Installing Picalo

Installing Python2.6

  1. Download the Python installer for Windows from http://python.org
  2. Run the installer by double clicking the installer
  3. Install the Python in default location(C://Python26 is default location) for ease. If you are advanced user you can install it wherever you like.

Installing wxPython2.8-unicode-py26

  1. Download the wxPython installer for Windows from http://wxpython.org
  2. Run the installer by double clicking the installer
  3. Install the wxpython in default location.

Installing setuptools-0.6c11

  1. Install setuptools using instructions at http://pypi.python.org/pypi/setuptools

Installing chardet

  1. Open the Windows Command prompt (Start -> Run As -> Type cmd -> click OK)
  2. Change the directory to the Python installation directory using cd command. If the Python is installed in default location use the first command cd to change the directory to the default directory else use the cd command to change the directory to Python installation directory. The second command is common and issued after the first command cd.

C:>cd Python26Scripts
C:Python26Scripts> easy_install chardet.

Installing Picalo

  1. Download Picalo from
  2. Install Picalo
  3. Picalo installation is same as any other windows application software.

Creating Picalo Detectlets

The real power of Picalo lies in detectlets. Detectlets are used to expand the functionality of Picalo.Suppose you want to use Picalo for analyzing data present in an Excel sheet and after performing specific operations on the data you want to generate result excel sheet.This functionality is not directly available in Picalo but Picalo can be expanded to perform this task using Detectlet.

To create a Detectlet perform below steps

  1. Create a subdirectory under the picalo-N.N/picalo/tools/Detectlets directory(where N.N are version number eg 4.40). e.g. The Example_Blog
    subdirectory is created in this case
  2. Place the source code under the above sub directory e.g. Example_Blog. e.g. The source code analysis_blog.py is kept under the sub-directory Example_Blog.The analysis_blog.py contains code to perform above mentioned task of loading data from Excel sheet,performing operation on the data and creating reports
  3. Start the Picalo
  4. Go in the menu Tools–> Detectlets
  5. There the user will see an entry of the sub directory e.g in this case Example_Blog.
  6. In the Example_Blog sub menu the user will see the analysis_blog entry. Click on the entry.
  7. This will install the module in Picalo and is ready to use.

Coding Picalo detectlets

Detectlets are used to perform a specific operation needed by business.Detectlets are coded in Python language but with some difference(they do have .py extension).Detectlets are divided into 5 parts

Import section — The import section is used to import the functions needed later in the module.for example

from picalo import *
from math import log
from decimal import *

Declaration section — The declaration section is used to declare the detectlet version and detectlet standard

DETECTLET_STANDARD = 1.0
DETECTLET_VERSION = 1.0

Input Screen Section — The input screen section defines the input screens presented to the user.for example let the applications loads data from a worksheet of an excel file then the user should enter name of excel file and worksheet name of the excel file to be read by the application.The input screen section for this requirement can be coded as

wizard = ”’
<wizard>
<page>
Mention the fully qualified path name of Excel file containing the data to analyze.
for example On Unix platforms – /home/username/file-name.xls
<parameter type=”string” variable=”inputFileName”/>
Mention the Sheet Name of the Excel File containing the Data to analyze.
<parameter type=”string” variable=”inputSheetName”/> </page> </wizard>
”’

The input screen section starts with wizard=”’ <wizard> and each user interface screen is defined within <page></page> tags.In above example there is one input screen with two text boxes defined by the <parameter /> tag. The type defines data-type of value inserted in the text boxes and variable is variable name used to hold the values.

Output Screen section — In this section the output screen is designed.for example let in output screen you want to display a set of values i.e. table then the output screen section be

RESULTS_TEXT = ”’
The output table contains following columns
– Column 1
– Column 2
– Column 3
– Column 4
– Column 5
– Column 6
”’

Logic section — Logic section contains all the processing logic.It can be compared with main() function of C program or Python code.The Logic section begins with

def run(parameter1,parameter2,…..,parametern):

for example if input is excel file name and excel worksheet name as mentioned above then the function call becomes

def run(inputFileName,inputSheetName):

After this rest of function can be coded in same way as Python function.

Creating Picalo installers for Windows

Inno setup is an outstanding application and is great help to a new comer/freelancer.I have covered inno setup in details at this tutorial.To create installer using Inno setup follow below steps

  1. Download and install the Inno Setup software from http://www.jrsoftware.org/isdl.php.
  2. Click on the desktop icon to launch the application.The Inno setup start up screen is shown to the user.

Choose the option as shown in the picture to create a new Picalo Installer and click OK.Below screen will be displayed

Inno setup script wizard start up screen

On this screen dont choose any option and simply click on NEXT button.Application information screen is displayed.Provide all the information on application information screen and click on NEXT for details of application information screen visit blog Inno Setup Wizard application information screen

Application information screen of inno setup wizard

Application folder screen is displayed.Provide all the information on application folder screen and click on NEXT for details of application folder screen visit blog Inno Setup Wizard application folder screen

application folder screen of inno setup wizard

Application files screen is displayed.Provide all the information on application files screen and click on NEXT for details of application files screen visit blog Inno Setup Wizard Application files screen

application files screen of inno setup wizard

The last screen Application icons screen is displayed.Choose the options suiting the applications and click on NEXT.

application icons screen on inno setup screen

 

Consider sharing the post in case you found this helpful.

13 thoughts on “Picalo python data analysis tutorial

  1. Thanks for your grateful informations, am working in Ecommerce development company india, so it will be helpful info for my works.

    • glad to know you found this useful

  2. Thanks for the tutorial.
    I am trying to use Picalo on Windows but up to now I still have some problems.
    Is there a forum for Picalo?
    Or is it abandoned?

    • The last time I visited the site..there was windows installer available..it installs all the necessary packages..Are you using the installer?

      Have you visited their official website? The home page does not work (checked few days ago) but inner page works try searching picalo in Google..if you do not find any then let me know..I have book (pdf) and installer both

  3. Thanks for post on Picalo.I have installed Picalo 4.4 on window 7.When I open the application it throws error mssg: “Traceback (most recent call last):
    File “”, line 1, in
    ImportError: No module named etree.ElementTree”
    How to eliminate this error? Thanks in Advance

    • Have you used picalo exe for installation..You can also try installing http://effbot.org/downloads/#elementtree and see if the error still occurs..I have installed most recent version and it works..Is your python version less than 2.5

  4. Thanks for your reply.Yes I have used Picalo exe file for installation and my Python version is 3.3 for 64 bit.Also my system OS is windows 7 64 bit. but , in the link mentioned by you, I can see that the elementtree.exe is for 32 bit OS or maybe I am not able to locate 64 bit exe file.Any suggestion

    • Try uninstalling picalo and python..then install picalo..many python based softwares are not compatible with python 3.x version tree but are compatible with python 2.7.x tree

  5. INTERVIEW TIPS R NICE

  6. thanks

  7. Mam i have got 57 marks and interview was average …st category is there possiblity to get job ….and when the result is going to be out (ibps po )

  8. Where can i download Picalo from?

Leave a Comment