Publications by Harold Nelson

Unicode

20.10.2020

Unicode Harold Nelson 10/18/2020 Goals This presentation will give you enough comfort with Unicode and UTF-8 to be functional in almost all circumstances. The simple way to think about this topic is to see it as an extension of the character numbering system in the ASCII table. One major difference is that we speak of the character numbers as ...

2869 sym R (303 sym/21 pcs)

Translation Tables

20.10.2020

Translation Tables Harold Nelson 10/20/2020 Build a Translation Table intab = "aeiou" outtab = "12345" trantab = str.maketrans(intab, outtab) Use the table. s = "This is a string with vowels" s2 = s.translate(trantab) s2 ## 'Th3s 3s 1 str3ng w3th v4w2ls' What happened? All the lower case values were replaced with the numerical values accord...

462 sym R (222 sym/5 pcs)

Numpy

26.10.2020

Numpy Harold Nelson 10/25/2020 Setup Make the module numpy available with the alias np. Answer import numpy as np Now create and print a list, l_list, of the integers from 1 to 5. Answer l_list = [1,2,3,4,5] print(l_list) ## [1, 2, 3, 4, 5] Now Use the function np.array() to create a numpy array, a_array, with the same contents. Print the ar...

3735 sym R (1874 sym/59 pcs)

Caret Extreme Basics

20.11.2020

Caret Harold Nelson 11/18/2020 Caret The task is to predict the gender of a person based on other characteristics? This document works through several models using the caret package. It uses the cleaned version of the cdc data. The Data and Packages load("cdc2.Rdata") library(class) library(caret) ## Loading required package: ggplot2 ## Loadi...

1881 sym R (9595 sym/47 pcs)

Model Building 2

05.11.2020

Model Building 2 Harold Nelson 11/5/2020 A Model Building Exercise Can we predict how much weight people want to lose or gain? The Data We’ll use the cleaned version of the cdc dataset, cdc2. Load the data. load("cdc2.Rdata") Packages Make a few packages available. library(broom) library(ggplot2) library(dplyr) ## ## Attaching package: '...

3133 sym R (10120 sym/46 pcs) 1 img

Pandas Notes 2

04.11.2020

Pandas Notes 2 Harold Nelson 11/4/2020 Task 1 Make numpy available as np. Make pandas available as pd. Answer import numpy as np import pandas as pd Task 2 Get the Data. Using pd.read_csv create the dataframe OAW2 from the csv file. Set the row number to index 0. Answer OAW2 = pd.read_csv("OAW2.csv",index_col = 0) Task 3 Create a boolean v...

2044 sym R (4998 sym/46 pcs)

Pandas Notes 1

02.11.2020

Pandas Notes 1 Harold Nelson 11/1/2020 Setup In Cocalc, create a folder called “Pandas Notes”. Download the file OAW2.csv from Moodle. Then upload it to the folder you just created in Cocalc. Create a Jupyter notebook in the same folder to do the work below. The data is from the weather station at the Olympia Airport. Task 1 Make numpy av...

839 sym R (2200 sym/16 pcs)

TFR Regressions

29.10.2020

TFR Regressions Harold Nelson 10/29/2020 Library library(tidyverse) ## ── Attaching packages ──────── tidyverse 1.3.0 ── ## ✓ ggplot2 3.3.2 ✓ purrr 0.3.4 ## ✓ tibble 3.0.1 ✓ dplyr 1.0.0 ## ✓ tidyr 1.1.2 ✓ stringr 1.4.0 ## ✓ readr 1.3.1 ✓ forcats 0.5.0 ## ── Conflicts ──�...

1489 sym R (10018 sym/41 pcs)

Cebula 11-4-20

06.11.2020

Intro This is the result of reading the first sample of data from Sunset air. It is a csv file with hourly readings in cumulative kilowatt hours. The observations are all at 34 minutes after the hour. Libraries library(lubridate) ## ## Attaching package: 'lubridate' ## The following objects are masked from 'package:base': ## ## date, inter...

2733 sym R (4078 sym/33 pcs)

Pandas and R

09.11.2020

Pandas and R Harold Nelson 11/9/2020 Pandas and R Pandas was built as an attempt to bring the analytic capabilities of R to python. These notes look at the similarities and point out some areas where doing analytic work in R is easier. We’ll use the cdc dataset as an example. Setup First we need to load some libraries. This is the equivalent...

2242 sym R (5574 sym/27 pcs) 7 img