Showing posts with label numpy. Show all posts
Showing posts with label numpy. Show all posts

Thursday, December 01, 2016

IOT202 - Introduction to Data Science using Jupyter Notebook (Anaconda)

"Without data you're just another person with an opinion"
W. Edwards Deming, Data Scientist

Learn how to visualise and analyse your data using Python and its associated libraries. In this course, you will learn how to use Jupyter Notebook from the Anaconda package, and learn how to:

  • Visualise data using matplotlib
  • Clean data sets using NumPy
  • Perform Data Analytics using Pandas

IOT202 - Introduction to Data Science using Python
Course Fee
S$1297 (nett; no GST)
If your company is sponsoring you for the training, your company can enjoy 400% tax deductions/ allowances and/or 40% cash payout for investment in innovation and productivity improvements under the Productivity and Innovation Credit (PIC) scheme. For more details, check out the Productivity and Innovation Credit page. 
Schedules
Start DateEnd DateCourse Outline and Application FormCategory
Mon Dec 05 2016 CONFIRMEDTue Dec 06 2016
Thu Feb 16 2017Fri Feb 17 2017
Thu Mar 23 2017Fri Mar 24 2017
Venue
Hotel Grand Pacific Singapore
101 Victoria Street
Singapore 188018

If your company requires in-house training, you can contact us to customize the topics to meet your training requirements. We train worldwide! We have conducted customized classes in the United States, Canada, Norway, Denmark, Japan, China, Hong Kong, Taiwan, and Thailand.

Thursday, July 07, 2016

Data Science Workshop @ NDC Sydney 2016


Saturday, May 28, 2016

Learning Data Science using Python

Come and join us in our first Data Science series of courses:

IOT201 - Learning the Python Programming Language
IOT202 - Introduction to Data Science using Python


In IOT201, you will learn about the Python Programming language, and the various features that makes it one of the most popular programming languages for beginners as well as advanced programmers.

Once you have mastered the basics of Python, head over to IOT202, where you will learn the various modules and libraries that allow Python to crunch large amount of data. In particular, you will learn:

  • NumPy - an extension to the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays.
  • Pandas - a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series.
  • Matplotlib - a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. 

Once you have learned the basics of NumPy, Pandas, Matplotlib, it is time to make use of them to analyse your data. In particular, you will analyse:

  • Birth Rates in Singapore 
  • Different types of infectious diseases affecting Singapore 
  • Prevalence of diseases in adults in Singapore 
  • Historical trends of stocks
  • And more!

Friday, May 20, 2016

Sorting in NumPy

If you are into Python programming and are manipulating data, you should learn NumPy. NumPy  is an extension to the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays.

To use NumPy in your Python code, import the numpy module:

import numpy as np

To see how NumPy is useful, consider the following example:

persons = np.array(['Johnny','Mary','Peter','Will','Joe'])
ages = np.array([34,12,37,5,13])
heights = np.array([1.76,1.2,1.68,0.5,1.25])

In the above code snippet, I created three NumPy arrays to store a list of persons’ name, as well as their corresponding age and height. NumPy arrays are similar to Python’s list, except that NumPy arrays contains elements of the same type. Let’s print them out and example their contents:

print '---Before sorting---'
print persons
print ages
print heights

You should see the following:

---Before sorting---
['Johnny' 'Mary' 'Peter' 'Will' 'Joe']
[34 12 37  5 13]
[ 1.76  1.2   1.68  0.5   1.25]

Suppose we want to sort the elements based on certain axis, such as ages. After the sort, you would want to print the sorted ages as well as the corresponding name and height. For this purpose, you can use the argsort() function in NumPy:

sort_indices = np.argsort(ages)  # performs a sort based on ages
                                 # and returns an array of indices
                                 # indicating the sort order

The argsort() function returns a list of indices, which you can examine by printing it out:

print '---Sort indices---'
print sort_indices

You should see the following:

---Sort indices---
[3 1 4 0 2]

To print the all the other arrays sorted by age, you can now pass the sort indices into the individual arrays, like this:

print '---After sorting---'
print persons[sort_indices]
print ages[sort_indices]
print heights[sort_indices]

This will print out the following:

---After sorting---
['Will' 'Mary' 'Joe' 'Johnny' 'Peter']
[ 5 12 13 34 37]
[ 0.5   1.2   1.25  1.76  1.68]

The argsort() function also works for strings, like this:

sort_indices = np.argsort(persons)
print persons[sort_indices]
print ages[sort_indices]
print heights[sort_indices]
'''
prints out the following:
['Joe' 'Johnny' 'Mary' 'Peter' 'Will']
[13 34 12 37  5]
[ 1.25  1.76  1.2   1.68  0.5 ]
'''

Sorting in Reverse Order

The argsort() function only sorts in ascending order. So what happens if you need to sort in descending order? Well, easy! In Python, [::-1] reverses the order of a list. This applies to NumPy arrays too.

Hence, to sort the persons’ names in descending order, first sort it in ascending order and then reverse the result, like this:

reverse_sort_indices = np.argsort(persons)[::-1]
print persons[reverse_sort_indices]
print ages[reverse_sort_indices]
print heights[reverse_sort_indices]

The above code snippet prints out the following:

['Will' 'Peter' 'Mary' 'Johnny' 'Joe']
[ 5 37 12 34 13]

[ 0.5   1.68  1.2   1.76  1.25]

Learning More

This article is just touching on the surface of what Python can do in the world of data analytics. To learn more about using Python for data analysis, come join my workshop (Introduction to Data Science using Python) at NDC Sydney 2016 on the 1-2 August 2016. See you there!

Monday, May 02, 2016

New Data Science Series in the IOT Suite of Courses

As I have mentioned many times, IoT (Internet of Things) is much more than collecting tons of data. It also involves analysing data to derive sense (forgive me for the pun) out of them and to use them to make intelligent decisions. Hence, we now have a new series of courses (more to be added) focusing on Data Science:

  • IOT201 - Learning the Python Programming Language
  • IOT202 - Introduction to Data Science using Python 

Python is such a useful language for manipulating data that we are making it the first language to learn in this series. It is also easy for beginners to pick up, and this makes learning Data Science much more palatable.