100% found this document useful (4 votes)
18 views

(Ebook) Learning IPython for Interactive Computing and Data Visualization - Second Edition by Cyrille Rossant ISBN 9781783986989, 1783986980 2024 scribd download

The document provides information on various eBooks related to IPython, data visualization, and interactive computing, including 'Learning IPython for Interactive Computing and Data Visualization - Second Edition' by Cyrille Rossant. It includes links for downloading the eBooks in multiple formats and highlights the author's background and contributions to the field. The document also outlines the book's content, focusing on Python programming and its applications in data analysis.

Uploaded by

elezinayla4c
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
18 views

(Ebook) Learning IPython for Interactive Computing and Data Visualization - Second Edition by Cyrille Rossant ISBN 9781783986989, 1783986980 2024 scribd download

The document provides information on various eBooks related to IPython, data visualization, and interactive computing, including 'Learning IPython for Interactive Computing and Data Visualization - Second Edition' by Cyrille Rossant. It includes links for downloading the eBooks in multiple formats and highlights the author's background and contributions to the field. The document also outlines the book's content, focusing on Python programming and its applications in data analysis.

Uploaded by

elezinayla4c
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download the Full Ebook and Access More Features - ebooknice.

com

(Ebook) Learning IPython for Interactive Computing


and Data Visualization - Second Edition by Cyrille
Rossant ISBN 9781783986989, 1783986980

https://ebooknice.com/product/learning-ipython-for-
interactive-computing-and-data-visualization-second-
edition-5480298

OR CLICK HERE

DOWLOAD EBOOK

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Learning IPython for Interactive Computing and Data Visualization by Cyrille
Rossant ISBN 9781783986989, 1783986980

https://ebooknice.com/product/learning-ipython-for-interactive-computing-and-
data-visualization-43206680

ebooknice.com

(Ebook) Learning IPython for Interactive Computing and Data Visualization by


Rossant, Cyrille ISBN 9781782169932, 1782169938

https://ebooknice.com/product/learning-ipython-for-interactive-computing-and-
data-visualization-55662116

ebooknice.com

(Ebook) IPython Interactive Computing and Visualization Cookbook by Cyrille Rossant


ISBN 9781783284818, 1783284811

https://ebooknice.com/product/ipython-interactive-computing-and-visualization-
cookbook-5325678

ebooknice.com

(Ebook) Interactive Data Visualization for the Web by Scott Murray ISBN
9781449339739, 1449339735

https://ebooknice.com/product/interactive-data-visualization-for-the-web-5551862

ebooknice.com
(Ebook) Interactive Data Visualization for the Web by Murray, Scott ISBN
9789595423166, 9789600423167, 9595423165, 9600423164

https://ebooknice.com/product/interactive-data-visualization-for-the-
web-11901598

ebooknice.com

(Ebook) Interactive Data Visualization for the Web: An Introduction to Designing


with D3 by Scott Murray ISBN 9781491921289, 1491921285

https://ebooknice.com/product/interactive-data-visualization-for-the-web-an-
introduction-to-designing-with-d3-6769294

ebooknice.com

(Ebook) Interactive Data Visualization for the Web: An Introduction to Designing


with D3 by Murray, Scott ISBN 9781449339739, 1449339735

https://ebooknice.com/product/interactive-data-visualization-for-the-web-an-
introduction-to-designing-with-d3-55920266

ebooknice.com

(Ebook) Interactive Data Visualization for the Web: An Introduction to Designing


with D3 by Scott Murray ISBN 9781491921289, 1491921285

https://ebooknice.com/product/interactive-data-visualization-for-the-web-an-
introduction-to-designing-with-d3-7187934

ebooknice.com

(Ebook) Interactive Web-Based Data Visualization with R, Plotly, and Shiny by Carson
Sievert ISBN 9781138331457, 1138331457

https://ebooknice.com/product/interactive-web-based-data-visualization-with-r-
plotly-and-shiny-10842110

ebooknice.com
[1]
Learning IPython for Interactive
Computing and Data
Visualization
Second Edition

Get started with Python for data analysis and numerical


computing in the Jupyter notebook

Cyrille Rossant

BIRMINGHAM - MUMBAI
Learning IPython for Interactive Computing
and Data Visualization
Second Edition

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book
is sold without warranty, either express or implied. Neither the author nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: April 2013

Second edition: October 2015

Production reference: 1151015

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78398-698-9

www.packtpub.com
Credits

Author Project Coordinator


Cyrille Rossant Shweta H Birwatkar

Reviewers Proofreader
Damián Avila Safis Editing
Nicola Rainiero
G Scott Stukey Indexer
Monica Ajmera Mehta

Commissioning Editor
Kartikey Pandey Production Coordinator
Conidon Miranda

Acquisition Editors
Kartikey Pandey Cover Work
Conidon Miranda
Richard Brookes-Bland

Content Development Editor


Arun Nadar

Technical Editor
Pranil Pathare

Copy Editor
Stephen Copestake
About the Author

Cyrille Rossant is a researcher in neuroinformatics, and is a graduate of Ecole


Normale Superieure, Paris, where he studied mathematics and computer science.
He has worked at Princeton University, University College London, and College
de France. As part of his data science and software engineering projects, he gained
experience in machine learning, high-performance computing, parallel computing,
and big data visualization.

He is one of the main developers of VisPy, a high-performance visualization package


in Python. He is the author of the IPython Interactive Computing and Visualization
Cookbook, Packt Publishing, an advanced-level guide to data science and numerical
computing with Python, and the sequel of this book.

I am grateful to Nick Fiorentini for his help during the revision of


the book. I would also like to thank my family and notably my wife
Claire for their support.
About the Reviewers

Damián Avila is a software developer and data scientist (formerly a biochemist)


from Córdoba, Argentina.

His main focus of interest is data science, visualization, finance, and


IPython/Jupyter-related projects.

In the open source area, he is a core developer for several interesting and popular
projects, such as IPython/Jupyter, Bokeh, and Nikola. He has also started his own
projects, being RISE, an extension to enable amazing live slides in the Jupyter
notebook, the most popular one. He has also written several tutorials about
the Scientific Python tools (available at Github) and presented several talks
at international conferences.

Currently, he is working at Continuum Analytics.

Nicola Rainiero is a civil geotechnical engineer with a background in the


construction industry as a self-employed designer engineer. He is also specialized
in the renewable energy field and has collaborated with the Sant'Anna University
of Pisa for two European projects, REGEOCITIES and PRISCA, using qualitative
and quantitative data analysis techniques.

He has an ambition to simplify his work with open software and use and develop
new ones; sometimes obtaining good results, at other times, negative. You can reach
Nicola on his website at http://rainnic.altervista.org.

A special thanks to Packt Publishing for this opportunity to


participate in the reviewing of this book. I thank my family,
especially my parents, for their physical and moral support.
www.PacktPub.com

Support files, eBooks, discount offers,


and more
For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub
files available? You can upgrade to the eBook version at www.PacktPub.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
[email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for
a range of free newsletters and receive exclusive discounts and offers on Packt books and
eBooks.
TM

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book
library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser

Free access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib
today and view 9 entirely free books. Simply use your login credentials for immediate access.
Table of Contents
Preface vii
Chapter 1: Getting Started with IPython 1
What are Python, IPython, and Jupyter? 1
Jupyter and IPython 2
What this book covers 4
References 5
Installing Python with Anaconda 5
Downloading Anaconda 6
Installing Anaconda 6
Before you get started... 7
Opening a terminal 7
Finding your home directory 8
Manipulating your system path 8
Testing your installation 9
Managing environments 9
Common conda commands 10
References 11
Downloading the notebooks 12
Introducing the Notebook 13
Launching the IPython console 13
Launching the Jupyter Notebook 14
The Notebook dashboard 15
The Notebook user interface 16
Structure of a notebook cell 16
Markdown cells 17
Code cells 18

[i]
Table of Contents

The Notebook modal interface 19


Keyboard shortcuts available in both modes 19
Keyboard shortcuts available in the edit mode 19
Keyboard shortcuts available in the command mode 20
References 20
A crash course on Python 20
Hello world 21
Variables 21
String escaping 23
Lists 24
Loops 26
Indentation 27
Conditional branches 27
Functions 28
Positional and keyword arguments 29
Passage by assignment 30
Errors 31
Object-oriented programming 32
Functional programming 34
Python 2 and 3 35
Going beyond the basics 36
Ten Jupyter/IPython essentials 37
Using IPython as an extended shell 37
Learning magic commands 42
Mastering tab completion 45
Writing interactive documents in the Notebook with Markdown 47
Creating interactive widgets in the Notebook 49
Running Python scripts from IPython 51
Introspecting Python objects 53
Debugging Python code 54
Benchmarking Python code 55
Profiling Python code 56
Summary 58
Chapter 2: Interactive Data Analysis with pandas 59
Exploring a dataset in the Notebook 59
Provenance of the data 60
Downloading and loading a dataset 61
Making plots with matplotlib 63
Descriptive statistics with pandas and seaborn 67

[ ii ]
Table of Contents

Manipulating data 69
Selecting data 69
Selecting columns 70
Selecting rows 70
Filtering with boolean indexing 72
Computing with numbers 73
Working with text 75
Working with dates and times 76
Handling missing data 77
Complex operations 78
Group-by 78
Joins 80
Summary 83
Chapter 3: Numerical Computing with NumPy 85
A primer to vector computing 85
Multidimensional arrays 86
The ndarray 86
Vector operations on ndarrays 87
How fast are vector computations in NumPy? 88
How an ndarray is stored in memory 89
Why operations on ndarrays are fast 91
Creating and loading arrays 91
Creating arrays 91
Loading arrays from files 93
Basic array manipulations 94
Computing with NumPy arrays 97
Selection and indexing 98
Boolean operations on arrays 99
Mathematical operations on arrays 100
A density map with NumPy 103
Other topics 107
Summary 108
Chapter 4: Interactive Plotting and Graphical Interfaces 109
Choosing a plotting backend 109
Inline plots 109
Exported figures 111
GUI toolkits 111
Dynamic inline plots 113
Web-based visualization 114

[ iii ]
Table of Contents

matplotlib and seaborn essentials 115


Common plots with matplotlib 116
Customizing matplotlib figures 120
Interacting with matplotlib figures in the Notebook 122
High-level plotting with seaborn 124
Image processing 126
Further plotting and visualization libraries 129
High-level plotting 129
Bokeh 130
Vincent and Vega 130
Plotly 131
Maps and geometry 132
The matplotlib Basemap toolkit 132
GeoPandas 133
Leaflet wrappers: folium and mplleaflet 134
3D visualization 134
Mayavi 134
VisPy 135
Summary 135
Chapter 5: High-Performance and Parallel Computing 137
Accelerating Python code with Numba 138
Random walk 138
Universal functions 141
Writing C in Python with Cython 143
Installing Cython and a C compiler for Python 143
Implementing the Eratosthenes Sieve in Python and Cython 144
Distributing tasks on several cores with IPython.parallel 148
Direct interface 149
Load-balanced interface 150
Further high-performance computing techniques 153
MPI 153
Distributed computing 153
C/C++ with Python 154
GPU computing 154
PyPy 155
Julia 155
Summary 155

[ iv ]
Table of Contents

Chapter 6: Customizing IPython 157


Creating a custom magic command in an IPython extension 157
Writing a new Jupyter kernel 160
Displaying rich HTML elements in the Notebook 165
Displaying SVG in the Notebook 165
JavaScript and D3 in the Notebook 167
Customizing the Notebook interface with JavaScript 170
Summary 172
Index 173

[v]
Preface
Data analysis skills are now essential in scientific research, engineering, finance,
economics, journalism, and many other domains. With its high accessibility and
vibrant ecosystem, Python is one of the most appreciated open source languages for
data science.

This book is a beginner-friendly introduction to the Python data analysis platform,


focusing on IPython (Interactive Python) and its Notebook. While IPython is an
enhanced interactive Python terminal specifically designed for scientific computing
and data analysis, the Notebook is a graphical interface that combines code, text,
equations, and plots in a unified interactive environment.

The first edition of Learning IPython for Interactive Computing and Data Visualization
was published in April 2013, several months before the release of IPython 1.0. This
new edition targets IPython 4.0, released in August 2015. In addition to reflecting the
novelties of this new version of IPython, the present book is also more accessible to
non-programmer beginners. The first chapter contains a brand new crash course on
Python programming, as well as detailed installation instructions.

Since the first edition of this book, IPython's popularity has grown significantly,
with an estimated user base of several millions of people and ongoing collaborations
with large companies like Microsoft, Google, IBM, and others. The project itself has
been subject to important changes, with a refactoring into a language-independent
interface called the Jupyter Notebook, and a set of backend kernels in various
languages. The Notebook is no longer reserved to Python; it can now also be used
with R, Julia, Ruby, Haskell, and many more languages (50 at the time of this
writing!).

[ vii ]
Preface

The Jupyter project has received significant funding in 2015 from the Leona M. and
Harry B. Helmsley Charitable Trust, the Gordon and Betty Moore Foundation, and
the Alfred P. Sloan Foundation, which will allow the developers to focus on the
growth and maturity of the project in the years to come.

Here are a few references:

• Home page for the Jupyter project at http://jupyter.org/


• Announcement of the funding for Jupyter at https://blog.jupyter.
org/2015/07/07/jupyter-funding-2015/
• Detail of the project's grant at https://blog.jupyter.org/2015/07/07/
project-jupyter-computational-narratives-as-the-engine-of-
collaborative-data-science/

What this book covers


Chapter 1, Getting Started with IPython, is a thorough and beginner-friendly
introduction to Anaconda (a popular Python distribution), the Python language, the
Jupyter Notebook, and IPython.

Chapter 2, Interactive Data Analysis with pandas, is a hands-on introduction to


interactive data analysis and visualization in the Notebook with pandas, matplotlib,
and seaborn.

Chapter 3, Numerical Computing with NumPy, details how to use NumPy for efficient
computing on multidimensional numerical arrays.

Chapter 4, Interactive Plotting and Graphical Interfaces, explores many capabilities of


Python for interactive plotting, graphics, image processing, and interactive graphical
interfaces in the Jupyter Notebook.

Chapter 5, High-Performance and Parallel Computing, introduces the various techniques


you can employ to accelerate your numerical computing code, namely parallel
computing and compilation of Python code.

Chapter 6, Customizing IPython, shows how IPython and the Jupyter Notebook can be
extended for customized use-cases.

[ viii ]
Preface

What you need for this book


The following software is required for the book:

• Anaconda with Python 3


• Windows, Linux, or OS X can be used as a platform

Who this book is for


This book targets anyone who wants to analyze data or perform numerical
simulations of mathematical models.

Since our world is becoming more and more data-driven, knowing how to analyze
data effectively is an essential skill to learn. If you're used to spreadsheet programs
like Microsoft Excel, you will appreciate Python for its much larger range of analysis
and visualization possibilities. Knowing this general-purpose language will also let
you share your data and analysis with other programs and libraries.

In conclusion, this book will be useful to students, scientists, engineers, analysts,


journalists, statisticians, economists, hobbyists, and all data enthusiasts.

Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"Run it with a command like bash Anaconda3-2.3.0-Linux-x86_64.sh (if
necessary, replace the filename by the one you downloaded)."

A block of code is set as follows:


def load_ipython_extension(ipython):
"""This function is called when the extension is loaded.
It accepts an IPython InteractiveShell instance.
We can register the magic with the `register_magic_function`
method of the shell instance."""
ipython.register_magic_function(cpp, 'cell')

[ ix ]
Preface

Any command-line input or output is written as follows:


$ python
Python 3.4.3 |Anaconda 2.3.0 (64-bit)| (default, Jun 4 2015, 15:29:08)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this: "To create
a new notebook, click on the New button, and select Notebook (Python 3)."

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it helps
us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention


the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.
You can also report any issues at https://github.com/ipython-books/minibook-
2nd-code/issues.

[x]
Preface

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

Downloading the example code


You can download the example code files from your account at http://www.
packtpub.com for all the Packt Publishing books you have purchased. If you
purchased this book elsewhere, you can visit http://www.packtpub.com/support
and register to have the files e-mailed directly to you. You will also find the book's
code on this GitHub repository: https://github.com/ipython-books/minibook-
2nd-code.

Downloading the color images of this book


We also provide you with a PDF file that has color images of the screenshots/
diagrams used in this book. The color images will help you better understand the
changes in the output. You can download this file from https://www.packtpub.
com/sites/default/files/downloads/6989OS_ColouredImages.pdf.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or added
to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/


content/support and enter the name of the book in the search field. The required
information will appear under the Errata section.

[ xi ]
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated


material.

We appreciate your help in protecting our authors and our ability to bring you
valuable content.

Questions
If you have a problem with any aspect of this book, you can contact us at
[email protected], and we will do our best to address the problem.
Getting Started with IPython
In this chapter, we will cover the following topics:

• What are Python, IPython, and Jupyter?


• Installing Python with Anaconda
• Introducing the Notebook
• A crash course on Python
• Ten Jupyter/IPython essentials

What are Python, IPython, and Jupyter?


Python is an open source general-purpose language created by Guido van Rossum
in the late 1980s. It is widely-used by system administrators and developers for many
purposes: for example, automating routine tasks or creating a web server. Python is
a flexible and powerful language, yet it is sufficiently simple to be taught to school
children with great success.

In the past few years, Python has also emerged as one of the leading open
platforms for data science and high-performance numerical computing. This might
seem surprising as Python was not originally designed for scientific computing.
Python's interpreted nature makes it much slower than lower-level languages like
C or Fortran, which are more amenable to number crunching and the efficient
implementation of complex mathematical algorithms.

However, the performance of these low-level languages comes at a cost: they are
hard to use and they require advanced knowledge of how computers work. In the
late 1990s, several scientists began investigating the possibility of using Python for
numerical computing by interoperating it with mainstream C/Fortran scientific
libraries. This would bring together the ease-of-use of Python with the performance
of C/Fortran: the dream of any scientist!

[1]
Getting Started with IPython

Consequently, the past 15 years have seen the development of widely-used libraries
such as NumPy (providing a practical array data structure), SciPy (scientific
computing), matplotlib (graphical plotting), pandas (data analysis and statistics),
scikit-learn (machine learning), SymPy (symbolic computing), and Jupyter/IPython
(efficient interfaces for interactive computing). Python, along with this set of
libraries, is sometimes referred to as the SciPy stack or PyData platform.

Competing platforms
Python has several competitors. For example, MATLAB (by Mathworks)
is a commercial software focusing on numerical computing that is
widely-used in scientific research and engineering. SPSS (by IBM) is a
commercial software for statistical analysis. Python, however, is free and
open source, and that's one of its greatest strengths. Alternative open
source platforms include R (specialized in statistics) and Julia (a young
language for high-performance numerical computing).

More recently, this platform has gained popularity in other non-academic


communities such as finance, engineering, statistics, data science, and others.

This book provides a solid introduction to the whole platform by focusing on one
of its main components: Jupyter/IPython.

Jupyter and IPython


IPython was created in 2001 by Fernando Perez (the I in IPython stands for
"interactive"). It was originally meant to be a convenient command-line interface
to the scientific Python platform. In scientific computing, trial and error is the rule
rather than the exception, and this requires an efficient interface that allows for
interactive exploration of algorithms, data, and graphs.

In 2011, IPython introduced the interactive Notebook. Inspired by commercial


software such as Maple (by Maplesoft) or Mathematica (by Wolfram Research), the
Notebook runs in a browser and provides a unified web interface where code, text,
mathematical equations, plots, graphics, and interactive graphical controls can be
combined into a single document. This is an ideal interface for scientific computing.
Here is a screenshot of a notebook:

[2]
Chapter 1

Example of a notebook

It quickly became clear that this interface could be used with languages other than
Python such as R, Julia, Lua, Ruby, and many others. Further, the Notebook is not
restricted to scientific computing: it can be used for academic courses, software
documentation, or book writing thanks to conversion tools targeting Markdown,
HTML, PDF, ODT, and many other formats. Therefore, the IPython developers
decided in 2014 to acknowledge the general-purpose nature of the Notebook by
giving a new name to the project: Jupyter.

Jupyter features a language-independent Notebook platform that can work with


a variety of kernels. Implemented in any language, a kernel is the backend of the
Notebook interface. It manages the interactive session, the variables, the data, and so
on. By contrast, the Notebook interface is the frontend of the system. It manages the
user interface, the text editor, the plots, and so on. IPython is henceforth the name
of the Python kernel for the Jupyter Notebook. Other kernels include IR, IJulia,
ILua, IRuby, and many others (50 at the time of this writing).

[3]
Getting Started with IPython

In August 2015, the IPython/Jupyter developers achieved the "Big Split" by splitting
the previous monolithic IPython codebase into a set of smaller projects, including
the language-independent Jupyter Notebook (see https://blog.jupyter.
org/2015/08/12/first-release-of-jupyter/). For example, the parallel
computing features of IPython are now implemented in a standalone Python
package named ipyparallel, the IPython widgets are implemented in ipywidgets,
and so on. This separation makes the code of the project more modular and facilitates
third-party contributions. IPython itself is now a much smaller project than before
since it only features the interactive Python terminal and the Python kernel for the
Jupyter Notebook.

You will find the list of changes in IPython 4.0 at http://ipython.


readthedocs.org/en/latest/whatsnew/version4.html.
Many internal IPython imports have been deprecated due to the
code reorganization. Warnings are raised if you attempt to perform
a deprecated import. Also, the profiles have been removed and
replaced with a unique default profile. However, you can simulate
this functionality with environment variables. You will find more
information at http://jupyter.readthedocs.org.

What this book covers


This book covers the Jupyter Notebook 1.0 and focuses on its Python kernel,
IPython 4.0. In this chapter, we will introduce the platform, the Python language,
the Jupyter Notebook interface, and IPython. In the remaining chapters, we will
cover data analysis and scientific computing in Jupyter/IPython with the help of
mainstream scientific libraries such as NumPy, pandas, and matplotlib.

This book gives you a solid introduction to Jupyter and the SciPy
platform. The IPython Interactive Computing and Visualization Cookbook
(http://ipython-books.github.io/cookbook/) is the sequel of
this introductory-level book. In 15 chapters and more than 500 pages,
it contains a hundred recipes covering a wide range of interactive
numerical computing techniques and data science topics. The IPython
Cookbook is an excellent addition to the present IPython minibook if
you're interested in delving into the platform in much greater detail.

[4]
Chapter 1

References
Here are a few references about IPython and the Notebook:

• The main Jupyter page at: http://jupyter.org/


• The main Jupyter documentation at: https://jupyter.readthedocs.org/
en/latest/
• The main IPython page at: http://ipython.org/
• Jupyter on GitHub at: https://github.com/jupyter
• Try Jupyter online at: https://try.jupyter.org/
• The IPython Notebook in research, a Nature note at http://www.nature.
com/news/interactive-notebooks-sharing-the-code-1.16261

Installing Python with Anaconda


Although Python is an open-source, cross-platform language, installing it with the
usual scientific packages used to be overly complicated. Fortunately, there is now
an all-in-one scientific Python distribution, Anaconda (by Continuum Analytics),
that is free, cross-platform, and easy to install. Anaconda comes with Jupyter and all
of the scientific packages we will use in this book. There are other distributions and
installation options (like Canopy, WinPython, Python(x, y), and others), but for the
purpose of this book we will use Anaconda throughout.

Running Jupyter in the cloud


You can also use Jupyter directly from your web browser, without
installing anything on your local computer: go to http://try.
jupyter.org. Note that the notebooks created there are not saved.
Let's also mention a similar service, Wakari (https://wakari.io),
by Continuum Analytics.

Anaconda comes with a package manager named conda, which lets you manage
your Python distribution and install new packages.

Miniconda
Miniconda (http://conda.pydata.org/miniconda.html) is
a light version of Anaconda that gives you the ability to only install
the packages you need.

[5]
Getting Started with IPython

Downloading Anaconda
The first step is to download Anaconda from Continuum Analytics' website
(http://continuum.io/downloads). This is actually not the easiest part since
several versions are available. Three properties define a particular version:

• The operating system (OS): Linux, Mac OS X, or Windows. This will depend
on the computer you want to install Python on.
• 32-bit or 64-bit: You want the 64-bit version, unless you're on an old or low-
end computer. The 64-bit version will allow you to manipulate large datasets.
• The version of Python: 2.7, or 3.4 (or later). In this book, we will use
Python 3.4. You can also use Python 3.5 (released in September 2015)
which introduces many features, including a new @ operator for matrix
multiplication. However, it is easy to temporarily switch to a Python 2.7
environment with Anaconda if necessary (see the next section).

Python 3 brought a few backward-incompatible changes over Python 2 (also


known as Legacy Python). This is why many people are still using Python
2.7 at this time, even though Python 3 was released in 2008. We will use
Python 3 in this book, and we recommend that newcomers learn Python
3. If you need to use legacy Python code that hasn't yet been updated to
Python 3, you can use conda to temporarily switch to a Python 2 interpreter.

Once you have found the right link for your OS and Python 3 64-bit, you can
download the package. You should then find it in your downloads directory
(depending on your OS and your browser's settings).

Installing Anaconda
The Anaconda installer comes in different flavors depending on your OS, as follows:

• Linux: The Linux installer is a bash .sh script. Run it with a command
like bash Anaconda3-2.3.0-Linux-x86_64.sh (if necessary, replace the
filename by the one you downloaded).
• Mac: The Mac graphical installer is a .pkg file that you can run with a
double-click.
• Windows: The Windows graphical installer is an .exe file that you can run
with a double-click.

[6]
Chapter 1

Then, follow the instructions to install Anaconda on your computer. Here are a few
remarks:

• You don't need administrator rights to install Anaconda. In most cases, you
can choose to install it in your personal user account.
• Choose to put Anaconda in your system path, so that Anaconda's Python is
the system default.

Anaconda comes with a graphical launcher that you can use to start
IPython, manage environments, and so on. You will find more details
at http://docs.continuum.io/anaconda-launcher/

Before you get started...


Before you get started with Anaconda, there are a few things you need to know:
• Opening a terminal
• Finding your home directory
• Manipulating your system path

You can skip this section if you already know how to do these things.

Opening a terminal
A terminal is a command-line application that lets you interact with your computer
by typing commands with the keyboard, instead of clicking on windows with the
mouse. While most computer users only know Graphical User Interfaces, developers
and scientists generally need to know how to use the command-line interface for
advanced usage. To use the command-line interface, follow the instructions that are
specific to your OS:

• On Windows, you can use Powershell. Press the Windows + R keys, type
powershell in the Run box, and press Enter. You will find more information
about Powershell at https://blog.udemy.com/powershell-tutorial/.
Alternatively, you can use the older Windows terminal by typing cmd in the
Run box.
• On OS X, you can open the Terminal application, for example by pressing
Cmd + Space, typing terminal, and pressing Enter.
• On Linux, you can open the Terminal from your application manager.

In a terminal, use the cd /path/to/directory command to move to a given


directory. For example, cd ~ moves to your home directory, which is introduced in
the next section.
[7]
Getting Started with IPython

Finding your home directory


Your home directory is specific to your user account on your computer. It generally
contains your applications' settings. It is often referred to as ~.Depending on the OS,
the location of the home directory is as follows:

• On Windows, its location is C:\Users\YourName\ where YourName is the


name of your account.
• On OS X, its location is /Users/YourName/ where YourName is the name of
your account.
• On Linux, its location is generally /home/yourname/ where yourname is the
name of your account.

For example, the directory ~/anaconda3 refers to C:\Users\YourName\anaconda3\


on Windows and /home/yourname/anaconda3/ on Linux.

Manipulating your system path


The system path is a global variable (also called an environment variable) defined
by your operating system with the list of directories where executable programs are
located. If you type a command like python in your terminal, you generally need
to have a python (or python.exe on Windows) executable in one of the directories
listed in the system path. If that's not the case, an error may be raised.

You can manually add directories to your system path as follows:

• On Windows, press the Windows + R keys, type rundll32.exe sysdm.


cpl,EditEnvironmentVariables, and press Enter. You can then edit the
PATH variable and append ;C:\path\to\directory if you want to add
that directory. You will find more detailed instructions at http://www.
computerhope.com/issues/ch000549.htm.
• On OS X, edit or create the file ~/.bash_profile and add export
PATH="$PATH:/path/to/directory" at the end of the file.
• On Linux, edit or create the file ~/.bashrc and add export PATH="$PATH:/
path/to/directory" at the end of the file.

[8]
Chapter 1

Testing your installation


To test Anaconda once it has been installed, open a terminal and type python. This
opens a Python console, not to be confused with the OS terminal. The Python
console is identified with a >>> prompt string, whereas the OS terminal is identified
with a $ (Linux/OS X) or > (Windows) prompt string. These strings are displayed
in the terminal, often preceded by your computer's name, your login, and the
current directory (for example, yourname@computer:~$ on Linux or PS C:\Users\
YourName> on Windows). You can type commands after the prompt string. After
typing python, you should see something like the following:
$ python
Python 3.4.3 |Anaconda 2.3.0 (64-bit)| (default, Jun 4 2015, 15:29:08)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

What matters is that Anaconda or Continuum Analytics is mentioned here.


Otherwise, typing python might have launched your system's default Python, which
is not the one you want to use in this book.

If you have this problem, you may need to add the path to the Anaconda executables
to your system path. For example, this path will be ~/anaconda3/bin if you chose to
install Anaconda in ~/anaconda3. The bin directory contains Anaconda executables
including python.

If you have any problem installing and testing Anaconda, you can ask for help on
the mailing list (see the link in the References section under the Installing Python with
Anaconda section of this chapter).

Next, exit the Python prompt by typing exit() and pressing Enter.

Managing environments
Anaconda lets you create different isolated Python environments. For example, you
can have a Python 2 distribution for the rare cases where you need to temporarily
switch to Python 2.

[9]
Getting Started with IPython

To create a new environment for Python 2, type the following command in an OS


terminal:
$ conda create -n py2 anaconda python=2.7

This will create a new isolated environment named py2 based on the original
Anaconda distribution, but with Python 2.7. You could also use the command conda
env: type conda env -h to see the details.

You can now activate your py2 environment by typing the following command in a
terminal:

• Windows: activate py2 (note that you might have problems with
Powershell, see https://github.com/conda/conda/issues/626, or use the
old cmd terminal)
• Linux and Mac OS X: source activate py2

Now, you should see a (py2) prefix in front of your terminal prompt. Typing
python in your terminal with the py2 environment activated will open a Python 2
interpreter.

Type deactivate on Windows or source deactivate on Linux/OS X to deactivate


the environment in the terminal.

Common conda commands


Here is a list of common commands:

• conda help: Displays the list of conda commands.


• conda list: Lists all packages installed in the current environment.
• conda info: Displays system information.
• conda env list: Displays the list of environments installed. The currently
active one is marked by a star *.
• conda install somepackage: Installs a Python package (replace
somepackage by the name of the package you want to install).
• conda install somepackage=0.7: Installs a specific version of a package.
• conda update somepackage: Updates a Python package to the latest
available version.
• conda update anaconda: Updates all packages.
• conda update conda: Updates conda itself.

[ 10 ]
Exploring the Variety of Random
Documents with Different Content
go about from place to place; kanaka i ka ohi i ka ia, a me na
but just looked on as the men wahine.
and women helped themselves
to the fish.

While she was sitting there Ia ia e noho ana ma laila, ike


Puniakaia saw her and was mai la o Puniakaia i ka wahine
captivated by her beauty and maikai o Kaalaea, i ka noho
quiet demeanor, not at all like malie, i ka like ole me na wahine
the other women; so he said to e ae, alaila, olelo aku la o
his mother, Halekou, 5 “Say, Puniakaia i kona makuahine ia
Halekou, I am going to secure Halekou: “E Halekou e, e kii ana
that woman for my own, au i kela wahine na’u, no ka
because she is very beautiful, mea, he wahine maikai loa, aohe
without blemish, and in all puu, aohe kee, ua like kona
respects my equal.” Halekou maikai me ko’u.” Ae mai o
gave her consent, saying: “Yes, Halekou: “Ae, o kau wahine ia,
she shall be your wife, for you ua like olua a elua, ua like na
two are alike in looks and kino, na maikai, na nani, nolaila,
behavior, therefore you go and e kii oe i wahine nau.”
ask her.”

When Puniakaia came to the A hiki o Puniakaia i mua o


presence of Kaalaea, he asked Kaalaea, olelo aku la i wahine
the woman that she become his nana, ae mai la no o Kaalaea; i
wife. Kaalaea gave her consent aku no nae o Puniakaia ia
to this. Puniakaia then said to Kaalaea: “E, i hele kaua a hiki i
her: “When we get to my mua o ka makuahine o kaua,
mother, don’t be backward but mai hilahila oe, hele no oe a
go and sit on her lap.” When the noho i luna o na uha.” Hele aku
two came to Halekou, Kaalaea la laua a hiki i mua o Halekou,
went and sat on the lap of her noho iho la o Kaalaea i luna o na
future mother-in-law. After a uha o Halekou, a liuliu iki, kena
little while Halekou ordered the ae la o Halekou i na kanaka, e
men to load the ten canoes with hooili i ka ia i na waa he umi, a
fish, and this was done; not only pela na waa e ae; piha i ka
the ten canoes but several waiwai, o keia waiwai, he waiwai
others also were filled, and this hookupu na na mea a pau.
property was distributed as gifts Hookupu o Halekou i kana
to the people. Halekou began to waiwai na Kaalaea, pela o
contribute gifts to Kaalaea, as Nuupia, hookupu i kana waiwai
was the custom 6 of those days. ia Kaalaea, a pela o Puniakaia,
Nuupia then did likewise, and akolu lakou i hookupu ia
then Puniakaia; those three Kaalaea, hookahi no o Kaalaea o
brought offerings to Kaalaea. In ka hookupu ana, ua oi kana
giving the various gifts, great waiwai i mua o ka na mea ekolu.
heaps of them, Kaalaea on her A pau ka hookupu ana, hoi aku
part gave only herself, still it la o Kaalaea i kona wahi me
exceeded that of all three. After kona mau kaikunane a me kona
the giving of gifts, Kaalaea mau makua.
returned to her place with her
brothers and her parents.

Sometime after this Puniakaia A hala lakou, nonoi aku o


asked of his mother that he go Puniakaia ia Halekou, e hoi me
and live with his wife. His ka wahine me Kaalaea e noho ai.
mother replied: “My son, listen I mai o Halekou: “E kuu keiki, e
to what I have to say: You are hoolohe mai oe, e hele ana oe i
going to the home of your wife ka hale o ko wahine e noho ai, e
to live, but you will be insulted mainoino ana nae oe, a e hoi
and you will return here in a very koke mai ana oe i anei, aole oe e
short time.” After this Puniakaia liuliu aku.” A pau ka Halekou
went to the home of Kaalaea his olelo ana, hele aku la ia i ko
wife, where they lived as Kaalaea wahi, a noho pu iho la
husband and wife. At meal times laua, he kane a he wahine. I ka
it was customary with the wa ai, he mea mau i na kaikoeke
brothers-in-law of Puniakaia to o Puniakaia ka hoomakaukau i
prepare the meal, then send for na mea ai, a me ka noho ana o
Puniakaia and make him sit on Puniakaia i luna o ka uha o kona
their lap while they fed him. This mau kaikoeke, a na lakou e
was carried on for some time; all hanai i ka wa e ai ai. Pela ka
Puniakaia did was to eat and hana mau ana o na kaikoeke ia
sleep and never left his wife. Puniakaia, a hala ka wa loihi,
hookahi no hana a Puniakaia o
ka hiamoe i na la a pau loa, me
ka wahine me Kaalaea.

One day while the two were in I kekahi la, ia laua e moe ana,
bed, an aunt of Kaalaea’s, hele mai la, kekahi makuahine o
together with several others, Kaalaea, a me kekahi poe e ae, a
came into the house where the hiki i kahi a laua nei e moe ana,
two were sleeping. These people e hele ana i ka lawaia papai. I
were on their way to catch mai la ka makuahine: “E
crabs. While in the house, the Kaalaea, e ala e hele kakou i ka
aunt said: “Wake up, Puniakaia, lawaia papai; o ke aha kau hana,
and let us go crabbing. What do o ka moe wale iho la no, a ala ae
you do, any way? Just sleep, and wae i ka piapia o na maka, popoi
when you get up clean your eyes i ka nalo a ai ae.” Ia ia e olelo
and catch flies and eat?” While ana, e nana mai ana no o
the aunt was speaking, Puniakaia maloko o ke kihei
Puniakaia was listening through kalukalu nahenahe, me ke ala
the soft mantle that covered mai no, a hoolohe; aka, o ka
them; the aunt did not know makuahine nana i olelo, aole ona
this, however, for she thought he manao e ala ana, ua manao no
was asleep. ia, e hiamoe ana o Puniakaia.

This angered Puniakaia and he Aka, ua huhu loa o Puniakaia i


was sore displeased; and when keia lohe ana, nolaila,
his brothers-in-law came home hookananuha loa iho la ia i kona
he would not speak to them nor mau kaikoeke, aole ekemu, aole
go to eat food with them as hele pu e ai e like me mamua;
before. [158]Because of this nolaila, noonoo iho [159]la na
action of their brother-in-law kaikoeke i ke kumu o keia
they were very sad and hookananuha ana o ko lakou
pondered as to the reason of kaikoeke. O Puniakaia hoi, he
such action. Puniakaia, on the mea mau ka hiamoe i ka la a me
other hand, did nothing else but ka po a hala elua anahulu.
sleep day and night for over Nolaila, hoakoakoa ia na mea a
twenty days. Thinking that the pau loa ma kahi hookahi, na
matter would terminate kane, na wahine, na keiki, na
seriously, the brothers-in-law of mea a pau loa, alaila, ninau na
Puniakaia called the people kaikoeke i kela mea i keia mea o
together, men, women and lakou, i ka mea nana i olelo ino
children, and asked each and ko lakou kaikoeke o Puniakaia.
every one of them, who it was Aole nae he mea o lakou i hai
that had insulted their brother- mai; alaila, ninau ia o Puniakaia i
in-law; but no one could answer ka mea nana i olelo ino ia ia. Hai
the question. Failing in this aku la oia: “O ka makuahine no
Puniakaia was requested to tell o kakou, oia ka mea nana keia
them the person who had mau olelo ino, aole na kuu
insulted him. Puniakaia then wahine. I kekahi la, e moe ana
revealed the person’s name, maua, hele mai la lakou a hiki,
saying: “The person who pane mai la no o iala, penei, ‘e
insulted me is the aunt of my Kaalaea, e ala ae a hele kakou i
wife, and not my wife. One day ka papai; o ke aha ka loaa o ka
while we were in bed, the aunt hiamoe, o ke ala ae a wae i ka
with several others came into piapia o na maka, o ke poi i ka
our house and said: ‘Say, nalo a ai ae.’ Ia ia la e olelo ana,
Puniakaia, get up and let us go e moe ana wau, e hoaiki ana no
crabbing, for what can you get nae ko’u mau maka maloko o ke
by sleeping? Only to get up, kihei kalukalu; nolaila, nonohua
clean your eyes, catch flies and loa au.”
eat?’ While she was speaking, I
was lying down, but I could see
and hear through our thin
mantle. This is the reason why I
am sad and unhappy.”

When the brothers-in-law heard A lohe na kaikoeke, kena ae la e


this, they ordered that the aunt pepehi i ka makuahine, a make
be put to death. 7 After this order iho la ia, ia wa, o Puniakaia i hoi
was carried out, Puniakaia ai i kona wahi. A hiki aku la ia i
returned to his own home. When mua o Halekou ka makuahine,
he came in his mother’s ninau mai la o Halekou ia
presence, she asked him as to Puniakaia, hai aku la o Puniakaia
the reason of his return; he then i na mea a pau i hana ia nona i
told her everything relating to ka hale o ka wahine o Kaalaea. A
the treatment received by him lohe o Halekou, uwe iho la ia, a
while living with his wife. When olelo aku: “He oiaio, ua olelo aku
Halekou heard this, she wept au ia oe, e mainoino ana oe i ka
and said: “It is even as I said to hale o ko wahine, a ike pono iho
you, that you were to be insulted la oe.”
in the home of your wife, and
now you have seen it for
yourself.”

After living with his mother for a He mau la i hala o ka noho ana,
few days, Puniakaia decided to holo o Puniakaia i Kauai e
go to Kauai to make a visit; so makaikai ai, hele aku la ia a hiki i
he started out until he came to ka lae o Kaena ma Waianae, e
the Kaena point, at Waianae, noho ana keia poe e hoa i na
where he met some men who waa, a e holo i Kauai. Ninau aku
were lashing their canoe for a la o Puniakaia: “E holo ana ko
trip to Kauai. Puniakaia upon oukou waa i hea?” “I Kauai.”
coming up to these men, asked “Aole la hoi e pono owau kekahi
them: “Where are you going e holo pu me oukou?” “I ke aha
with this canoe?” “To Kauai.” hoi! O ka waa no paha ia.” O ke
“Can I go with you?” “And why kumu o keia ae ana e holo pu i
not? The canoe is yours.” 8 The Kauai, o ka nana mai o lakou la
reason why these people allowed a ike i ke kanaka maikai o
Puniakaia to go to Kauai with Puniakaia.
them was because he was such
a handsome looking man.

On coming to Kauai they landed Ma keia holo ana, pae aku la


at Wailua, where a high chiefess lakou ma Wailua i Kauai, e noho
was living. When she saw that ana i laila he wahine alii;
Puniakaia was such a handsome makemake mai la i ke kanaka
looking man she began to give maikai o Puniakaia, hookuli mai
him presents of great value and la i ka waiwai, kii mai la i kane
after a while she even proposed hoao maoli. Eia nae, he kane no
that she become his wife. All this ka ua wahine nei, he hanapilo,
time, however, she had a ma kekahi aoao no o Kauai kahi i
husband already, 9 who was then noho ai.
living at some distance on the
other side of Kauai.

Some time after Puniakaia had Mahope o keia noho ana, iho aku
been living with this woman, he la o Puniakaia i kahakai me ka
went down one day to the beach wahine, aia hoi, e hoomakaukau
accompanied by the woman and ana kekahi mau kanaka e holo i
there saw two men preparing to ka lawaia. Ninau aku la o
go out fishing. Upon coming up Puniakaia: “He aha ka olua
to the fishermen, Puniakaia lawaia?” Hai mai laua ala: “He
asked them: “What kind of lawaia oio, elua no nae kauna ke
fishing are you two going out loaa mai, aohe mahuahua loa.” I
for?” The two replied: “Oio 10 aku o Puniakaia: “Ae, owau no
fishing; but the most we will ka mea e loaa ai ka ia, mai ka
ever catch will be about eight, moana a ka honua, mai lalo a
not very many.” Puniakaia said: luna o ke kai, o ka ia, ohi ke
“Yes, I will be the one who will kanaka a haalele, kopi a pilau, ai
get you all you want, from the ka puaa me ka ilio, a e
ocean to the land, from the hoomaunauna.” Olelo mai na
bottom of the sea to the top and kanaka: “Wahahee oe; noho
the people will not be able to wale ae nei no makou i nei wahi
carry away all the fish; they will aohe ia pela ke ku ana.” [161]
salt some and the pigs and dogs
will eat their full and a lot will be
wasted.” The two men then said:
“You are deceiving us. We have
lived here all our lives and have
never seen so much fish.” [160]

In this discussion the husband of Ma keia hoopaapaa o lakou, lohe


the woman, who had aku la ke kane a ka wahine a ia
accompanied Puniakaia to the nei, olelo mai la ia: “Pili ia aku.”
beach heard it and so said: Alaila, pili iho la lakou, olelo aku
“Make a wager against him.” o Puniakaia: “E, aole e pili ana
Wagers were then made; but ko’u mau iwi i na waiwai
Puniakaia said: “Say, I am not lapuwale, eia wale no, he mau
going to wager my bones ahupuaa nunui eha, hookahi o
against worthless articles. If I kuu kua, hookahi o kuu alo, elua
must wager my bones I want to o na aoao.” Hooholo iho la lakou,
wager them against four large he umikumamalima la, ina i ike
pieces of land; one for my back; ole ia ka ia i loko o ia mau la,
one for my front; and two for my alaila, eo o Puniakaia, ina hoi i
sides.” This was acceptable, and ikeia, alaila, eo lakou la.
fifteen days were allowed
Puniakaia in which time he must
catch the amount of fish boasted
by him.
After the agreement was made, Ma keia noho ana o Puniakaia, a
Puniakaia lived on for eleven hala he umikumamakahi la, eha
days without once making a la i koe, alaila eo. Ia wa, e
move about catching any fish. makaukau ana kekahi waa e
On the eleventh day, however, holo i Oahu nei, no Waianae
he saw a canoe being prepared kekahi mau mea, a no
to sail for Oahu, manned by men Kaumakapili kekahi. Olelo aku o
from different districts of Oahu; Puniakaia: “E holo oukou a hiki i
some were from Waianae and Waianae, a noho iho ko Waianae
some were from Kaumakapili. mau mea, hoi aku olua a hiki i
When Puniakaia saw this he said Kaumakapili, pii aku olua a hiki i
to the men: “When you get to Nuuanu, nana aku olua i kai o
Waianae, those who belong to Kaneohe, e hamama mai ana ka
that place remain there; then I puka o kuu hale, hele aku olua a
wish you two who are going to hiki, e noho ana kuu makuahine
Kaumakapili to go up Nuuanu o Halekou. Olelo aku olua, i olelo
and when you get there look mai nei ke keiki a olua ia maua,
down to Kaneohe. You will see o Puniakaia ka inoa, ‘e hele oe a
my house with the door open. kahea i ka ia ana ia
Go down to it and when you find Uhumakaikai, e kolo aku i ka ia a
my mother, Halekou, tell her that hiki i Kauai, no ka mea, ekolu la i
her son, Puniakaia, has sent her koe o ka pili ana, alaila, pau na
word to go and call his fish la he umikumamalima, a i hiki
Uhumakaikai to urge forward the ole ka ia i loko o ia mau la,
fish to Kauai, because in three alaila, make o Puniakaia i loko o
days the time allowed him to ka umu.’ ”
catch a certain amount of fish
would expire; and failing to get
this fish he will be killed by being
cooked in an umu.”
After Puniakaia had made this A pau ka olelo ana a Puniakaia,
request the canoe set out and on holo mai la ka waa o ua poe nei
the evening of the same day the ia la, a ahiahi pae i Kou, ma keia
canoe reached the harbor of holo ana, o Keaumiki a me
Kou. On this voyage the friends Keauka, na hoa o Puniakaia
of Puniakaia, Keaumiki and kekahi i kokua i ka waa, ma keia
Keauka, 11 assisted the canoe, holo ana mai, o ia ke kumu i pae
hence its quick arrival. Also, the koke ai i Oahu nei. A ko Waianae
men who belonged to Waianae, mau mea hoi, haalele laua i ka
knowing that the request was manao i ko laua aina, no ka
urgent, decided to continue on mea, ua oi ko laua manao i ka
instead of stopping at their Puniakaia olelo, a me ka
destination. makemake i kona kino, pela
lakou a eha.

When they arrived at Kou, 12 they A pae lakou ma Kou, haalele i ka


left the canoe there and waa malaila, a pii aku la a hiki i
proceeded up Nuuanu, where Nuuanu, nana aku la i kai o
they looked down toward Kaneohe, e hamama mai ana ka
Kaneohe and they saw the house waha o ka hale o Puniakaia. Iho
with its open doorway as aku la lakou a hala o Kekele
described by Puniakaia. The men mahope, a hiki i Kaneohe hiki
then proceeded on down to the aku la lakou a ka hale, e noho
house and found Halekou the mai ana o Halekou ka makuahine
mother of Puniakaia sitting on o Puniakaia, i luna o ka hua
some mats. The men extended moena.
their greetings and Halekou
returned the same. Halekou then Aloha aku la lakou, aloha mai la
asked the men: “What has o Halekou. Ninau mai la o
brought you here?” The men Halekou: “Heaha ka oukou o ka
replied: “We have come on the hiki ana mai?” I mai la lakou:
request of a boy by the name of “He kauoha na ko keiki, o
Puniakaia.” When Halekou heard Puniakaia ka inoa, oia ko makou
this, she wept as well as the mea i hele mai la e olelo aku ia
chiefs and common people, and oe.” A lohe o Halekou, uwe iho la
said: “We thought that Puniakaia ia a me na ’lii a pau loa, na
was dead; but we see now that makaainana, a olelo mai la: “Ka,
he is still alive. What has he Ua manao makou ua make o
requested you to do?” “He told Puniakaia, aole ka! A heaha kana
us that we come and tell you olelo ia oukou?” “Eia kana olelo
that you go and call for his fish, ia makou, e hele mai makou a
Uhumakaikai, and request that it olelo ia oe, e hele oe e kahea i
drive some fish to Kauai; ka ia ana, ia Uhumakaikai, e kolo
because Puniakaia made a aku i ka ia a hiki i Kauai. No ka
wager with the king of Kauai, mea, ua pili o Puniakaia me ke
that in fifteen days he could ’lii o Kauai, he umikumamalima
catch a certain amount of fish, la, ina ike ole ia ka ia maloko o
and that if this amount of fish ia mau la, make o Puniakaia, ina
was not caught within this given i ikeia ola o Puniakaia; nolaila, o
time, Puniakaia would be killed. ka umikumamalua keia o ka la,
Now this is the twelfth day and ekolu la i koe make o Puniakaia.”
we have only three days left if A lohe o Halekou i keia olelo, i
Puniakaia is to be saved.” When mai la ia: “Aole paha auanei e
Halekou heard this, she said: “I lohe ka ia ana ia’u, ia ia wale no
am afraid the fish will not obey paha e lohe ai; aka, e hele aku
my call; for he is the only one au e hoao.”
that could make the fish do his
bidding; but I shall go and try.”

Because of this kind deed Haawi aku la o Halekou i ua poe


performed by these people, nei, hookahi ahupuaa, hookahi
Halekou gave unto them a large hale kapa, hookahi hale ai,
piece of land, together with one hookahi hale ia, hookahi hale
house full of kapas, one house to moe, a loaa keia mau mea ia
eat in, one [162]house for fish, lakou, noho loa [163]iho la lakou
and one house for them to sleep ilaila, me ka manao ole e hoi i ko
in. Upon receiving these gifts the lakou hale; hoohiki iho la lakou
men decided to live there and to mamuli o Puniakaia a make
abandon their old homes and at lakou, me ko lakou haalele ole ia
the same time they vowed that ia.
they would live and die serving
Puniakaia.

Halekou after this went out Hele aku la o Halekou me na ’lii


accompanied by the chiefs, until a pau loa, a hiki i kahi o
they came to the pool where Uhumakaikai i hooholo ia ai, he
Uhumakaikai made its home. kaheka ia, aia ma Nuupia e
This pool is at Nuupia to this waiho nei a hiki i keia la. Kahea
day. Halekou then called out: aku la o Halekou: “E kolo mai! E
“Draw along, draw along, draw kolo mai! E kolo mai i ka ia e
along the fish, Uhumakaikai; Uhumakaikai; ma Kona ma
from Kona and Koolau to Kauai Koolau, a hiki i Kauai i kahi o ko
where your master Puniakaia kahu o Puniakaia. Mai lohi, mai
now is. Don’t be slow, don’t wait, kali, o make ko kahu i loko o ka
else your master will be cooked umu.” A pau ke kahea ana a
in the umu.” At the close of this Halekou, ia wa, api ana ke kai i
call, the sea was seen to be ka ia, lana ana o Uhumakaikai
disturbed and Uhumakaikai malalo o Halekou, lalau iho la a
passed below Halekou. She then hu ae la, honi iho la a hookuu
took up the fish, kissed it and aku la, olelo iho la o Halekou: “E
allowed it to go again. Halekou wiki oe o make ko kahu.”
then said: “Make haste, else
your master will die.”

This was the fourteenth day and O ka umikumamaha keia o na la;


there was yet left but one day, hookahi la i koe pau na la he
when Puniakaia would be killed, umikumamalima, alaila, make o
for the umu, the wood, the Puniakaia, no ka mea, ua
stones and the covering were makaukau ka umu, ka wahie, ke
ready. On the approach of a, ke kauwawe. Ia po a ao ae,
daylight the next day, the fish iho aku la ka ia, ma Kona o
were seen coming to Kauai by Kauai, iho ma Koolau a hui i
way of Kona and by way of Wailua. O Puniakaia, ua hoi aku
Koolau, until both schools met at la ia me ka wahine o Kauai, a
Wailua. Puniakaia on this last noho i ka lae kahakai, e kiai ana
day went down to the beach i kana ia, ia Uhumakaikai.
accompanied by the Kauai
woman; and they went and sat
on the seashore to wait for the
arrival of Uhumakaikai.

During the night, however, Ia laua i moe ai ia po, loaa ia


Puniakaia dreamed a dream in Puniakaia ka moeuhane, e olelo
which he heard the remark: mai ana penei: “Eia au o
“Uhumakaikai is coming. Why Uhumakaikai a hiki aku; no ke
did you leave me behind and go aha no la oe i haalele ai ia’u, a
alone to a strange land? You do hele hookahi oe i ka aina
not love me. If I did not hear of malihini; aloha ole oe ia’u, ina
your trouble, you would have aole au e lohe, make oe?” A pau
been killed?” After he woke up ka moe ana, puoho ae la ia a
he found that he had been hiaa iho la, me ka noonoo i ke
dreaming so he became ano o ka moe, mahope o keia
sleepless, wondering what the noonoo ana, kau mai la ka
dream meant. After studying for halialia aloha ia ia o
some time a feeling of affection Uhumakaikai.
came upon him for Uhumakaikai.

After the night was spent and A hala ae la ka po, hiki mai la ka
the dawn of the new day began wehe ana o ka pawa o ke ao, oili
to break, Puniakaia came out of ae la ia a waho o ka hale, nana
the house and looked toward the aku la ia i ke kai, ua hele a ehu i
sea, when he saw the surface as ka ia, mai luna, a lalo. Ia wa,
well as the lower portion of the holo ana o Uhumakaikai malalo
sea brown with fish. Shortly after ona, lalau iho la ia a hii ae la,
this Uhumakaikai passed below honi iho la, a kaukau iho: “U;
him; he then reached down, aole au i manao e haalele ia oe, i
took it up and hugged and hele mai au me kuu manao e
kissed it. Then he said: “Yes, I makaikai ia Oahu a puni, alaila,
did not intend to leave you hoi aku ia oe, eia ka au e hala
behind; I came with the idea of ana i Kauai nei, nolaila, mai ike
making a tour of sightseeing ole oe i ko’u puumake, e hiki ole
around Oahu, and then go back mai nei oe, make au.”
to you; but instead I came to
Kauai and came near not being
able to see you again. Had you
failed me I would have been
killed.”

Puniakaia then released Hookuu aku la o Puniakaia ia


Uhumakaikai and the fish began Uhumakaikai, ia wa, hiki mai la
to come ashore at Wailua. The ka ia a ku i uka o Wailua, mai ke
fish covered the sand and kai a ke one maloo, ka piha i ka
extended some distance into the ia, ia wa ike na mea a pau loa o
sea. The people of Wailua and Wailua, a me ke ’lii nana ka pili,
the king who made the wager a hooholo ae la ua eo ia
saw the fish and they agreed Puniakaia. Haawi ae la o
that Puniakaia had won. Puniakaia ia Kauai a puni, i ka
Puniakaia then gave the whole mea nona ka waa ana i holo aku
of Kauai to the owner of the ai mai Oahu aku nei, a noho alii
canoe that had brought him to iho la ia, a hoi mai la o Puniakaia
Kauai, who then became the i Oahu nei me ka wahine o
king. Puniakaia and his Kauai Kauai. [164]
queen then returned to Oahu.
[155]
1 Puniakaia, coveting fish, or given to
fishing proclivities. ↑
2 Perhaps, Panuhunuhu (Callyodon
ahula). ↑
3 Uhu (Parrot-fish) makaikai, sight-
seeing; indicating a roving, sight-
seeing uhu. ↑
4 Kaalaea, name also of a portion of
the Koolau district. ↑
5 It is quite customary for children to
address their parents or other
relatives by name, rather than
relationship. ↑
6 This probably has reference to
hookupu, though that custom of
giving gifts had a broader application. ↑
7 Rather summary punishment for a
relative’s insult. ↑
8 Evidently “yours to command.” ↑
9 Described as “he hanapilo;” an
uncomplimentary term, signifying
putrid or bad-smelling. ↑
10 Oio, Bone-fish (Albula vulpes). ↑
11 Keaumiki and Keauka, favoring gods
of the wind and tide. ↑
12 Kou, ancient name for the harbor of
Honolulu. ↑

[Contents]
Legend of Maniniholokuaua He Kaao no

and Keliimalolo. Maniniholokuaua a me

Keliimalolo.

Maniniholokuaua was a man He kanaka kaulana o


noted for his great strength and Maniniholokuaua, i ka ikaika a
fleetness of foot; he lived in me ka mama, no Molokai; aohe
Molokai. He was without equal in ona lua i ke amo i na ukana
the carrying of great heavy kaumaha loa, oia ka waa a me
objects such as canoes and na mea e ae. He kukini mama
other things. Keliimalolo on the loa hoi o Keliimalolo no Oahu
other hand was the greatest nei, elima puni o Oahu nei ia ia i
runner on the island of Oahu, he loko o ka la hookahi ke holo,
being able to make five complete aohe ona lua ma ia hana o ke
circuits of Oahu in one day; he kukini. O kahi noho o
had no equal on that island as a Maniniholokuaua, o
runner. Kaunakahakai i Molokai, aia i uka
kona wahi me ke kupunawahine
Maniniholokuaua lived at (moo), o Kalamaula ka inoa, he
Kaunakakai in Molokai, while his ana nui ko laua hale e noho ai. O
lizard grandmother lived in the kana hana, o ka auamo i ka waa
uplands at a place called i uka o Kaunakahakai, ke pae
Kalamaula, in a large cave which mai, me na mea a pau loa.
served her as a dwelling place. It
was Maniniholokuaua’s custom
to steal and carry away to the
cave all the canoes and other
valuables from the strangers
who landed at Kaunakakai.
Keliimalolo of Oahu once upon a O Keliimalolo, no Oahu nei ia,
time, desiring to visit Molokai, holo aku ia me kona waa maikai
set out in his best canoe taking me ka upena, a me ka ai, na
with him his nets, plenty of food pono a pau loa, a pae ma
and all other things necessary Kaunakahakai i Molokai. Kahea
for the visit, and landed at mai na kamaaina: “E Keliimalolo,
Kaunakakai, Molokai. As he hapai ia mai ka waa a loko nei o
landed the people of the place ka halau waiho, e lilo auanei ia
called out to him: “Say, Maniniholokuaua, ke keiki amo
Keliimalolo, bring your canoe and waa o uka nei.” I aku o
leave it in the canoe shed, Keliimalolo: “Heaha ka mea e lilo
otherwise it will be stolen by ai ko’u waa ia ia, he mama no
Maniniholokuaua, the boy who ia?” Hele aku la o Keliimalolo e
steals and carries away canoes.” auau i ka wai, a wehe ae la i
Keliimalolo then replied: “How kahi malo a me ke kapa, a waiho
can he get away with my canoe, ma kapa, lele iho auau i ka wai.
is he a fast runner?” With these
words Keliimalolo went to a pool
of water, disrobed, left his
clothes on the edge of the pool
and jumped in for a wash.

Soon after this Maniniholokuaua Ku ana o Maniniholokuaua i ka


arrived and approached the waa, paipai ana i ka aoao o ka
canoe. He then patted the sides waa: “Ko’u waa! Ko’u waa! A
of the canoe and said: “My make ko’u waa! A make ko’u
canoe, my canoe. I will own this waa!” I aku o Keliimalolo: “Uoki
canoe, I will own this canoe.” kuu waa, mai lawe oe, ea! Uoki
Keliimalolo answered: “Leave my kuu waa, mai lawe oe.” Ia
canoe alone; don’t take it. Leave Keliimalolo e olelo ana, hapai ae
my canoe alone; don’t take it.” la o Maniniholokuaua i ka waa
While Keliimalolo was talking, me na pono a pau loa o luna, a
Maniniholokuaua lifted the canoe amo ae la, a holo aku la me ka
on his back with everything it mama loa. Hahai o Keliimalolo
contained and ran off at great mahope me kona mama a pau
speed. Keliimalolo upon seeing loa, aohe launa aku mahope o
this came out of the water and Maniniholokuaua. A hiki ia i ke
chased after the thief; but he ana, kahea aku la: “E ana,
was not able to catch up with huaina!” a komo o
Maniniholokuaua. As soon as Maniniholokuaua me ka waa i
Maniniholokuaua arrived at the loko o ke ana. “E ana! poia.” Poia
cave, he called out: “Open up, O loa iho la ka waha o ke ana. Ia
cave.” The cave opened and wa, hamo ana o Keliimalolo
Maniniholokuaua entered with mawaho o ke ana, oi imi wale i
the canoe. As soon as he was puka, aohe loaa iki, hoi aku la
within, he again called: “Close me ke kaumaha.
up, O cave,” and the mouth of
the cave was closed. No sooner
than this was done when
Keliimalolo arrived on the outside
of the cave and began feeling for
an opening; but after hunting in
vain he returned heavy hearted.

Because of this loss of his canoe, No keia lilo ana o ka waa, hoi
he immediately returned to Oahu mai la i Oahu a holo ma Kauai, e
and soon after set out for Kauai, imi ana i makaia, nana e kii ka
in search of some one who waa. Eia ke ano o ia huaolelo,
would be able to return him his makaia, he kanaka mama loa i
canoe. He wished to get a good ka holo. Holo aku la keia a pae
runner. On this trip to Kauai he ma Mana i Kauai, hapai aku la i
first landed at Mana; after he na waa a kau i uka, hele aku la e
landed he carried his canoe auau, wehe ae la i kahi malo a
ashore and went for a swim. kapae ma kapa, lele iho la auau i
Upon coming to the pool he loko o ka wai. Ku ana o
disrobed and jumped in. Just as Kamaakamikioi me
he got into the water, Kamaakauluohia, mai Niihau mai
Kamaakamikioi and laua, he mau keiki laua na
Kamaakauluohia arrived from Halulu. He mau kanaka mama
Niihau. They were the sons of laua ma ka hele ana, he umi
Halulu. These two men were puni o Kauai i ka la hookahi; no
noted for their fleetness and ko laua mama loa, ua hiki ia laua
could make ten circuits of Kauai ke holo mai ka aina a ke kai, mai
in one day. Being very swift they ka honua a i ka lewa, he oi ko
could run on land and sea and laua mama mamua o Keliimalolo
from the earth to the skies. They a me Maniniholokuaua. Lalau iho
were greater runners than either la laua i ka malo o Keliimalolo, a
Keliimalolo or Maniniholokuaua. holo aku la, alualu aku la o
As soon as they arrived at the Keliimalolo mahope, aohe launa
pool they picked up the malo of aku, holo aku la laua la a loko o
Keliimalolo and ran away with it. ke kai ku mai. Kahea aku o
Keliimalolo got out of the pool Keliimalolo: [167]“Hoi mai olua i
and started to chase the two to uka nei i mau aikane olua na’u.”
try and recover his malo; but he A hiki mai la laua, i aku o
could not catch up with them. Keliimalolo: “O olua ka ka mea e
The two ran out onto the sea, on ku ai kuu makaia.” Hai aku la oia
the surface, and when at some i kona holo ana i Molokai, a me
distance from the shore they ka lilo ana o ka waa ia
stood and looked at Keliimalolo. Maniniholokuaua.
Keliimalolo [166]then called out to
them, saying: “You two come A lohe laua la. Olelo mai o
ashore and let us be friends.” Kamaakamikioi a me
After the two had come ashore Kamaakauluohia: “Ae, e hoi oe i
Keliimalolo said to them: “You Oahu, a na po i o Kane hiki aku
two will be the means of maua; e kau ana auanei elua
restoring to me what I have opua la o maua ia.” Eia nae, i
lost.” He then related to them his aku laua ia Keliimalolo: “E
trip to Molokai and how his kaapuni kakou ia Kauai nei i
canoe was stolen by hookahi la.” Ae mai o Keliimalolo.
Maniniholokuaua. After the two
had listened to the narrative,
they said to Keliimalolo: “You
return to Oahu and in the nights
of Kane, we will come. When
you see two narrow pointed
clouds hanging in the horizon
make sure that the clouds are
ourselves and we will come soon
after that.” The two then asked
Keliimalolo: “Let us all make a
circuit of Kauai in one day.” This
was consented to by Keliimalolo.

Early the next morning they set I ke kakahiaka, hoomaka lakou e


out on their trip around Kauai. hele i ke kaapuni ia Kauai;
Kamaakamikioi and hookahi puni o Kauai ia laua nei
Kamaakauluohia soon made their a hoi aku, e hele ana no o
first round and overtook Keliimalolo i ke ahupuaa
Keliimalolo who was still in the hookahi, hele hou laua nei a
course of finishing the first puni o Kauai, hoi hou aku, e hele
ahupuaa. The two made another ana o Keliimalolo i ka lua o ke
round and again overtook Ahupuaa. Umi puni o Kauai ia
Keliimalolo, who was in the laua nei, ahiahi o ua la nei, aole i
second ahupuaa. They made ten puni o Kauai ia Keliimalolo, he
rounds of the island of Kauai by kaulele o ka mama o na mama,
evening of the same day; but aole e loaa ka lua. Hoi aku la
Keliimalolo was not able to make lakou moe, a ao ae hoi mai la o
one round. They were indeed Keliimalolo i Oahu nei, noho iho
great runners, having no equal. la kakali i na aikane.
That night they retired together,
and on the next morning
Keliimalolo set out on his return
to Oahu, where he awaited the
arrival of his two friends.

On the approach of the nights of A hiki i na po o Kane, kau ana


Kane, Keliimalolo saw two elua opua i ka lewa, ku ana o
pointed clouds hanging in the Kamaakamikioi me
horizon; and very soon after this Kamaakauluohia. Kau aku la
Kamaakamikioi and lakou ma na waa a holo aku la, a
Kamaakauluohia arrived. They owakawaka o ke kakahiaka nui
then boarded a double canoe komo i Kaunakahakai, komo
and set out for Molokai. At dawn lakou nei a pae i ke awa, kau iho
of that morning they arrived at la no ka waa i kahi i kau mua ai
Kaunakakai and carried their ka waa o Keliimalolo, kaha aku la
canoe ashore; at the place hele e auau i ka wai.
where Keliimalolo left his canoe
on his previous visit. They then Ia lakou nei i ka moana, nana
set out for the pool to take a mai la o Maniniholokuaua i ka
bath. While the canoe was still in waa a ike, olelo aku i ke
mid-ocean, Maniniholokuaua kupunawahine ia Kalamaula:
looked and saw a canoe “Ko’u waa, ko’u waa.” I aku o
approaching; so said to his Kalamaula: “Ea! Mai kii oe i ka
grandmother, Kalamaula: “There waa, ke kau mai nei ia’u ka haili
is my canoe, there is my canoe.” o na keiki a Halulu o Niihau; ina
Kalamaula replied: “You must oia kela waa, make kaua, aole
not attempt to steal that canoe ou, he heana maikai, owau ka
as I have a premonition that the hoi o ka heana ino.”
sons of Halulu of Niihau are on
that canoe. If they are on that
canoe we will be killed. I have
no regrets for myself for I am
old; but I am sorry for you, for
you are yet young.”
Maniniholokuaua then set out for Iho mai la o Maniniholokuaua a
the landing. When he got to the hiki i ka waa, paipai ana ma ka
place where the canoe was lying, aoao: “Ko’u waa, ko’u waa.” I
he patted the sides and said: aku o Keliimalolo i na aikane:
“My canoe, my canoe.” “Aia ua keiki nei.” Kahea mai o
Keliimalolo upon seeing Keliimalolo: “Uoki kuu waa, mai
Maniniholokuaua said to his lawe oe.” Ko ianei auamo ae la
friends: “There is the boy.” no ia i ka waa a holo me ka
Keliimalolo then called out: mama loa, i aku o
“Leave my canoe alone; you Kamaakamikioi: “E! Ke pii nei au
must not take it.” Heedless of a hiki i uka, i a mai ke ahi, ua
the call, Maniniholokuaua took make ia’u, pii ae oukou.” Kokoke
up the canoe, placed it on his kela i ke ana me ka waa, ku ana
back and ran off at the top of his keia mahope; kahea kela: “E
speed. Kamaakamikioi then said: ana, huaina.” E kahea aku ana
“I am going after that fellow. If keia: “E ana, poia.” Paa pu o
you see a fire burning, it is a Maniniholokuaua me ka waa i ke
sign that I have killed him; you ana a make iho la. Kahea keia:
may then come up.” As “E ana, wehe ia.” Komo keia i
Maniniholokuaua was almost up loko, loaa o Kalamaula, make ia
to the cave, Kamaakamikioi ia nei; i nana aku ka hana ua
caught up with him. piha ke ana i ka waa a me na
Maniniholokuaua then called out: waiwai he nui loa. Oili ae la keia
“Open up, O cave,” and a waho, puku i ke ahi, a a, pii
Kamaakamikioi thereupon called aku la o kai nei; o na waiwai a
out: “Close up, O cave.” No pau loa o ke ana ka Molokai i
sooner than the cave was amo ai a puni, aole i pau. [168]
opened it immediately closed
again catching Maniniholokuaua
and the canoe in its jaws, killing
Maniniholokuaua. Kamaakamikioi
then called out: “Open up, O
cave.” The cave opened and he
entered in. He found Kalamaula
and she was killed. When he
looked about the cave he saw
that it was filled with canoes of
every description and many
things of great value. He then
went out of the cave to light the
fire, and when the people saw it
they all came up to the cave and
carried away the valuables; but
the people of the whole of
Molokai were unable to carry
away all of the things in the
cave. [165]

[Contents]
Legend of Opelemoemoe. He Kaao no Opelemoemoe.

Kalauao in Ewa was where O Kalauao i Ewa, kahi noho o


Opelemoemoe 1 made his home. Opelemoemoe. He kanaka hana
This man performed some very kupanaha loa ia, aohe ona lua
extraordinary things, things the mamua aku ona, a mahope mai
like of which had not been seen ona a hiki i keia mau la hope. E
before him nor since. He could hiki ia ia ke moe mai ka la mua o
keep asleep from the first day of ka malama a ka la hope, a, ina
the month to the end of the nae e kui ka hekili, alaila ala; a i
month; but if a thunder storm ole e kui ka hekili, aole oia e ala
occurred he would then wake a hala ka makahiki. Ina e hele
up; otherwise he would keep on oia ma ke alanui, a maka
sleeping for a whole year. If he hiamoe, o ka moe iho la no ia
should be walking along the road me ke ala ole, aia no a kui ka
and should become sleepy, he hekili, alaila ala, i ka po, i ke ao, i
would then sleep without once ke kau ame hooilo; pela ke holo i
getting up, until it thundered, ka moana, ina maka hiamoe,
when he would get up and moe no i lalo o ke kai a kui ka
would stay awake for days and hekili, ala. Aohe lua o ka hana a
nights at a time, in summer and keia eueu.
in winter. So would it be if he
was out in the ocean; if he fell
asleep, he would sleep in the sea
until it thundered, when he
would wake up. He was without
equal in his extraordinary
behavior.
Once upon a time Opelemoemoe Hele aku la o Opelemoemoe mai
set out from Kalauao for Kalauao aku a Puuokapolei, oioi
Puukapolei, where he fell asleep. iho la, moe iho la ia i laila,
He slept for a period of nearly kokoke e hala ke anahulu okoa,
ten days; it perhaps lacked two elua nae paha po i koe anahulu.
days, when a couple of men Ia ia e moe ana, hiki mai la keia
arrived from Kauai, who were on mau kanaka mai Kauai mai, e
their way in search of a human hele ana laua e imi i kanaka kau
sacrifice for the temple of no ka heiau o Lolomauna i Pokii,
Lolomauna, at Pokii, Kauai. Kauai. Hoala iho la laua ia
These men upon seeing Opelemoemoe, aohe ala, auamo
Opelemoemoe tried to wake him ae la laua a hiki i Pokai, i laila na
up, but in this they were waa, kau aku la ma ka waa a hoi
unsuccessful. They then carried i Kauai. Lawe aku la laua ia
him on their backs to Pokai, 2 at Opelemoemoe a hiki i ka heiau o
which place their canoes were Lolomauna, kau aku la laua ia
moored, placed him in the canoe Opelemoemoe i luna o ka heiau,
and carried him off to Kauai. o ka puaa, o ka maia, o ka niu, o
After landing they again carried ka awa hookahi ke kau ana i
Opelemoemoe and placed him luna o ka heiau. Ma keia kau ana
on the altar in the temple of i luna o ka heiau, aole i ala o
Lolomauna, together with a pig, Opelemoemoe, aohe pala o ke
some bananas, some coconuts kino a helelei; o ka maia, ka
and some awa. During all this puaa, ka ia, ka awa, o lakou kai
time Opelemoemoe never once helelei i lalo. Pela no ke kau ana
awoke from his sleep. It was o Opelemoemoe, a hiki i ke kui
noticed that his body did not ana o ka hekili, ala ae la ia, ua
decay like the rest of the things paa i ka nakii ia na wawae a me
that were placed on the altar; for na lima; kalakala ae la ia a
the bananas, the pig, the fish hemo, hoi mai la i lalo.
and the awa all rotted.
Opelemoemoe was then left on
the altar until one day it
thundered, when he awoke and
found himself tied hand and
foot. He then untied himself and
got down from the altar.

From the temple he went off Hele aku la ia a Waimea, moe


until he came to Waimea, where wahine, noho iho la i laila, nonoi
he married and settled down. aku la i ka wahine i aina mahiai,
One day he asked his wife for a haawi mai la ka wahine he mau
piece of land to farm on; so the kihapai; i aku o Opelemoemoe,
wife pointed out to him certain haawi mai a nui ka aina i mahiai
patches; at sight of the land aku wau. Mahiai aku la o
Opelemoemoe asked that he be Opelemoemoe, he ao he po, pau
given some larger farm lands so ka aina i ka mahi, paa i ka ai.
that he could cultivate them.
Upon getting the lands from his
wife he began tilling both day
and night until the lands were all
cleared and planted.

One day Opelemoemoe felt Moe iho la o Opelemoemoe, i


sleepy, and said to his wife, aku i ka wahine ia
Kalikookalauae: “I am falling off Kalikookalauae: “Ke moe nei au,
to sleep, so don’t attempt to mai hoala oe i kuu hiamoe. I hiki
wake me up. If our friends mai ka makamaka o kaua, mai
should come don’t disturb me; if hoala oe; i hiki mai ka waiwai,
fortune should come do not mai hoala oe; i pilikia oe, mai
awaken me; if you should be in hoala oe, mai noho oe a
danger, don’t arouse me; and kaniuhu, hoala oe ia’u; he kapu
don’t ever complain, but just kuu hiamoe.” Moe o
leave me alone and don’t wake Opelemoemoe a hala he
me up, for I have placed a kapu anahulu, a hala hou he anahulu,
over it.” Opelemoemoe then fell olelo iho o Kalikookalauae: “Ka!
off to sleep. This sleep was Kupanaha! Kai no paha o ka moe
continued for ten days, 3 and still a e nei kau a moe, aole ka! O ka
another ten days. At this moe a make no kau.” Kii aku la
extraordinary length of time keia hoala, hooluliluli, ninini i ka
taken up in his sleep, wai i na maka, hoohalululu, aohe
Kalikookalauae said to herself: ala ae. Kahea aku keia i na
“How strange this is! I had no kaikunane, ia [171]Popoloau a me
idea of the length of time you Kawaikoi, i na kanaka, ia Poo a
were going to sleep, but I see me Mahamaha, e hele mai. A
you sleep like a dead person.” hiki lakou, olelo aku keia, ua
She then tried to wake him up; make ke ’lii, e owili a paa, lawe i
she shook him, poured water in loko o ke kai e waiho ai. Lawe a
his eyes, made [170]some noise ku la lakou a loko o ke kai,
and still he slept on. She then moku, a waiho i lalo o ka
called for her brothers, Popoloau moana; ke moe nei no o
and Kawaikoi, and her servants Opelemoemoe, aole i ala. Ia ia i
Poo and Mahamaha, to come in. lalo o ke kai e moe ana, ua pau
When they arrived she said: loa kona ili i ka ai ia e ka ia.
“The chief is dead; let us wrap
him up and carry him off and
cast him into the sea.” The
brothers and men then did as
they were told, and cast him into
the sea. Opelemoemoe slept on
as though he was on land, never
once moving. In this sleep the
fish came around and ate his
skin.

After some months had lapsed, Ua hala he mau malama ka moe


during which time Opelemoemoe ana o Opelemoemoe ilalo o ke
slept on at the bottom of the kai, me ka make ole. Kui ka
sea, a thunder storm came up hekili, ala o Opelemoemoe i
and Opelemoemoe awoke. When nana ae ka hana eia i lalo o ke
he looked about him, he saw kai kahi i moe ai, ua paa i ka
that he was at the bottom of the opeope ia a me ke kaula, ua
sea, all wrapped up and bound nakii ia a paa. Ala ae la ia, wehe
with cords. He then sat up and i na kaula i paa ai, a pau i ka
began to untie himself, and after hemo, hoi aku la i uka e noho ai;
he was free from the cords he aohe ili, ua pau i ka pukapuka,
came to the surface and swam kokolo aku la ia a ka hale puaa
ashore. He had no skin, he was noho, mai laila aku a kekahi hale
covered with sores and was e aku, e noho ana he kahuna
unable to walk; so he crawled to lapaau ilaila, hana ia iho la keia a
a pig pen where he sat down; ola. Hele aku la keia a hiki i ka
from this place he crawled to wahine, noho iho la laua, a hala
another house where a priest he mau anahulu, hapai ka
was living who gave him some wahine i ke keiki.
medicine and treated him until
he was well. He then went back
to his wife and they lived on as
formerly. After the lapse of
certain periods of tens of days,
his wife conceived a child.

At about this time Opelemoemoe I loko o keia wa, olelo aku o


said to his wife: “I am returning Opelemoemoe: “E, ke hoi nei au
to Oahu and I want you to keep i Oahu; eia ka’u kauoha ia oe, i
this my word. If you should give hanau ae he keiki kane, kapa oe
birth to a boy, give him the i kona inoa, o Kalelealuaka, a i
name of Kalelealuaka; and if manao e imi ae ia’u, eia ka maka
after he grows up he expresses la, he ihe.” Noho aku la ka
the desire to come in search of wahine o Kalikookalauae, a
me let have this token, 4 a spear.” hanau he keiki kane, kapa iho la
The wife lived on by herself until i ka inoa o Kalelealuaka, hanai
she gave birth to a boy to whom iho la a nui. He keu ke kolohe a
she gave the name of me ka eu; mimi iho la kela i ka
Kalelealuaka. She brought him umeke a me ka ipukai, pela ka
up until he was big. He was a hana mau ana. Nolaila, lele aku
great mischief-maker and would ka makuakane kolea papai ia
often urinate in the calabash of Kalelealuaka, uwe kela a olelo
food and such other mischievous aku ia Kalikookalauae ka
acts. Because of this, his step- makuahine: “Ea! E kuu
father often punished him; when makuahine, e hai mai oe i ko’u
Kalelealuaka would run off to his makuakane;” hoole aku ka
mother crying and would makuahine, aole ou makuakane
demand of her that she tell him e ae, o kou makuakane iho la no
of his father. The mother would ia. No ke koi pinepine o
then tell him that he had no Kalelealuaka i ka makuahine, e
other father than the one who hai mai i kona makuakane. Hai
was living with them. As this was aku o Kalikookalauae ia
continued for some time the Kalelealuaka: “Ae, he makuakane
mother at last told him, saying: kou, o Opelemoemoe ka inoa.
“Yes, you have a different father; Aia i Oahu i Kalauao, i Ewa ka
he is in Kalauao, Oahu, in the aina, o Kahuoi nae ke
district of Ewa, in the village of kulanahale.” Haawi mai la o
Kahuoi; his name is Kalikookalauae i ka ihe ia
Opelemoemoe.” Kalikookalauae Kalelealuaka, o ia ka maka a
then handed Kalelealuaka the Opelemoemoe i waiho ai
spear left by Opelemoemoe as mahope no ke keiki.
the token by which he was to
recognize his son.

Kalelealuaka then left Kauai and Haalele aku la o Kalelealuaka ia


set sail, first landing at Pokai, in Kauai, holo mai la a pae ma
Waianae, and from there Pokai, i Waianae, hele mai la
proceeded overland to Kalauao, mauka a Ewa, a Kalauao, hiki i
Ewa, and then to Kahuoi. When Kahuoi. Ua hele o Opelemoemoe
he came to the house which had i ka mahiai, aole o ka hale, hele
been pointed to him as the aku la o Kalelealuaka a ku ma
home of Opelemoemoe, he kuauna loi, kahea aku la: “E!
found that he had gone out kekee ka lalani kalo.”
farming, so he continued on to Hooponopono hou mai la o
the taro patches where he found Opelemoemoe, pela aku no ia
Opelemoemoe planting taro. lalani, o ia ana no. Olelo iho o
Kalelealuaka then stood on the Opelemoemoe: “Ka! Kupanaha!
edge of the patch and called O ka’u hana no ia e mahiai nei,
out: “Say, your rows of taro are aohe kekee o ka lalani, i keia la
crooked.” Opelemoemoe then hoi, aohe kekee a koe.” Nolaila,
began to straighten out the haalele i ka mahiai a hoi aku la
rows, row after row; but the boy ma kuauna. I aku o
would call out the same thing. Opelemoemoe ia Kalelealuaka:
Finally Opelemoemoe said: “How “Nawai ke kupu o oe?” “Nau no.”
strange this is! Here I have been “Na’u na wai?” “Nau no me
doing this right along and my Kalikookalauae, o Kalelealuaka
rows were never crooked, but wau ko keiki o Kauai.” Ia wa hoi
today, they seem to have all aku la laua i ka hale. [172]
gone crooked.” He thereupon
quit working and went to the
edge of the patch where
Kalelealuaka was standing; when
he got to the edge of the patch
he said: “Whose offspring art
thou?” “Your own.” “Mine by
whom?” “Yours with
Kalikookalauae. I am
Kalelealuaka, your son of Kauai.”
They thereupon returned to the
house. [169]

1 Sleeping Opele. ↑
2 Pokai (pronounced ko-ka-ee), a
place in Waianae. ↑
3 Anahulu, a ten day period, as we
speak of a dozen for twelve. ↑
4 Another deserting father’s token of
identity. ↑

[Contents]
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like