Skip to content
Snippets Groups Projects
python-data-1-warmup.ipynb 529 KiB
Newer Older
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
nbgitpuller's avatar
nbgitpuller committed
    "# Notebook 1 - Warm-up Exercises\n",
    "\n",
    "In this notebook we will warm up with a textual analysis exercise, using some of the assumed basic python knowledge for the course. We will see how to use some basic string methods as well as how to open and close files in python (later, some of these methods will be superceded by inbuild methods of data science packages we will use).\n",
    "\n",
    "For this we will be using the text [Humanistic Nursing by Josephine G. Paterson and Loretta T. Zderad](http://www.gutenberg.org/ebooks/25020). You already have this downloaded in your workspace.\n",
    "\n",
    "To open up the file, Python gives us a very handy function, we just have to give it the path to the file:"
   ]
  },
  {
   "cell_type": "code",
nbgitpuller's avatar
nbgitpuller committed
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "file = open(\"data/humanistic_nursing.txt\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An easy way to deal with text files is reading it line by line within a for loop:"
   ]
  },
  {
   "cell_type": "code",
nbgitpuller's avatar
nbgitpuller committed
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
nbgitpuller's avatar
nbgitpuller committed
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Project Gutenberg eBook, Humanistic Nursing, by Josephine Paterson, and Loretta Zderad\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "This eBook is for the use of anyone anywhere at no cost and with\n",
      "\n",
      "almost no restrictions whatsoever.  You may copy it, give it away or\n",
      "\n",
      "re-use it under the terms of the Project Gutenberg License included\n",
      "\n",
      "with this eBook or online at www.gutenberg.org\n",
      "\n",
      "\n",
      "\n",
      "** This is a COPYRIGHTED Project Gutenberg eBook, Details Below **\n",
      "\n",
      "**     Please follow the copyright guidelines in this file.     **\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Title: Humanistic Nursing\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Authors: Josephine Paterson and Loretta Zderad\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Release Date: April 8, 2008  [eBook #25020]\n",
      "\n",
      "\n",
      "\n",
      "Language: English\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "***START OF THE PROJECT GUTENBERG EBOOK HUMANISTIC NURSING***\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Copyright (C) 2007 by Josephine Paterson and Loretta Zderad.\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Humanistic Nursing\n",
      "\n",
      "\n",
      "\n",
      "(Meta-theoretical Essays on Practice)\n",
      "\n",
      "\n",
      "\n",
      "by Josephine Paterson and Loretta Zderad\n",
      "\n",
      "\n",
      "\n",
      "Copyright (C) 2007 by Josephine Paterson and sLoretta Zderad all rights\n",
      "\n",
      "reserved except as follows.  This e-text may be freely copied for\n",
      "\n",
      "academic and scholarly work with the copyright notice clearly affixed to\n",
      "\n",
      "all copies.  No commercial use may be made of any part of the text\n",
      "\n",
      "without the express permission of the copyright holders.\n",
      "\n",
      "\n",
      "\n",
      "This e-text version of the classic text \"Humanistic Nursing\" is\n",
      "\n",
      "made available with the kind permission of the authors and copyright\n",
      "\n",
      "holders, Josephine Paterson and Loretta Zderad. The book was originally\n",
      "\n",
      "written to define the Humanistic Nursing Theory which presented a way\n",
      "\n",
      "for each nurse to become-more as a person and to extend that\n",
      "\n",
      "becoming-more to the community of nurses in which he or she\n",
      "\n",
      "practices. The offering of this book in the \"free\" e-text format\n",
      "\n",
      "reiterates the continuing contribution of these two nurses long after\n",
      "\n",
      "their retirement from practice. It is their hope that nurses everywhere\n",
      "\n",
      "will take their vision for nursing and expand on it and integrate it\n",
      "\n",
      "into their nursing practice.  At the request of the authors this e-text\n",
      "\n",
      "version is complete with the original 1976 Front Matter.\n",
      "\n",
      "\n",
      "\n",
      "Susan Kleiman\n",
      "\n",
      "\n",
      "\n",
      "For more information or questions about the subject of Humanistic\n",
      "\n",
      "nursing or this e-text you may contact Professor Susan Kleiman, PhD, RN,\n",
      "\n",
      "CS, NPP at: susank@humanistic-nursing.com.  Alternatively you may visit\n",
      "\n",
      "the web site: www.humanistic-nursing.com.  The Humanistic Nursing\n",
      "\n",
      "Inquiry web site provides context for the major initiatives of\n",
      "\n",
      "humanistic nursing, which celebrate the enduring and immutable ideals of\n",
      "\n",
      "Humanism that give us insight into the fundamental truths of being in\n",
      "\n",
      "the world of nurses, patients, families, colleagues, and students.\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "FOREWORD to the 1976 Edition\n",
      "\n",
      "\n",
      "\n",
      "These essays will evoke different reactions from different\n",
      "\n",
      "readers. \"Well, I know that,\" for example, may be the reaction of a\n",
      "\n",
      "beginner in nursing; \"I wouldn't have said it that way but I knew that\n",
      "\n",
      "is really nursing.\" \"Since they've given us a methodology,\" perhaps from\n",
      "\n",
      "one more experienced in nursing; \"I'll give it a try.\" Others with still\n",
      "\n",
      "more or different kinds of experience may respond, \"It's about time\n",
      "\n",
      "nurses put that into words; it's about time.\"\n",
      "\n",
Loading
Loading full blame...