MTH 448/563 Data-Oriented Computing

Fall 2019

Day 2

Quizzes today

Let's test the quiz mechanism. Quiz name: 'test'. Content: 'hello'.

Your own question: At some point during class today, ask a question (something you don't understand, something you want to know). Use the quiz form with the quiz name 'my question day 2'.

A number during our continuing review of numpy.

Numpy indexing and broadcasting, cont'd.

In the context of a photograph !

examples of slices, boolean indexing, fancy indexing

Review of some python basics and gentle introduction to Pandas

Here is a short list of words and phrases: some_words.csv. Save it in the folder your Jupter Notebook is currently looking at.

pandas is a Python library for analyzing 2D tabular data ('panel data' is supposedly the origin of the name).

Load the data into a pandas "dataframe" as follows:

import pandas
df = pandas.read_csv('some_words.csv')

A dataframe is quite like a 2D numpy array except the rows and columns can have arbitrary labels instead of just successive integers.

Exercise: add columns to the dataframe containing

  • length of word
  • starts with a capital letter
  • number of vowels
  • proportion of vowels to total length
  • reversal of the word
  • is a palindrome
  • list of letters in alphabetical order
  • has its reversal also in the list