Skip to content

Instantly share code, notes, and snippets.

View ryanorsinger's full-sized avatar
🎏
Reading the readme... again :)

Ryan Orsinger ryanorsinger

🎏
Reading the readme... again :)
View GitHub Profile
@ryanorsinger
ryanorsinger / installing_anaconda_on_mac.md
Last active April 26, 2024 02:22
Installing Homebrew and Anaconda

Installing Homebrew and Anaconda on a Mac

Install Homebrew

Run the following command on your terminal to install Homebrew. Homebrew is a package manager for Macs and is used to install useful development tools and software.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Anaconda through Homebrew

  1. Run brew install --cask anaconda to install Anaconda
@ryanorsinger
ryanorsinger / list_comprehension_practice.py
Last active April 11, 2024 17:26
17 List Comprehension Exercises
# 17 list comprehension problems in python
fruits = ['mango', 'kiwi', 'strawberry', 'guava', 'pineapple', 'mandarin orange']
numbers = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 19, 23, 256, -8, -4, -2, 5, -9]
# Example for loop solution to add 1 to each number in the list
numbers_plus_one = []
for number in numbers:
numbers_plus_one.append(number + 1)
@ryanorsinger
ryanorsinger / tips.csv
Last active February 27, 2024 21:51
Tips Dataset
total_bill tip sex smoker day time size
16.99 1.01 Female No Sun Dinner 2
10.34 1.66 Male No Sun Dinner 3
21.01 3.5 Male No Sun Dinner 3
23.68 3.31 Male No Sun Dinner 2
24.59 3.61 Female No Sun Dinner 4
25.29 4.71 Male No Sun Dinner 4
8.77 2.0 Male No Sun Dinner 2
26.88 3.12 Male No Sun Dinner 4
15.04 1.96 Male No Sun Dinner 2
@ryanorsinger
ryanorsinger / attrition.csv
Last active December 26, 2023 16:20
HR Attrition Analysis
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 35 columns, instead of 8. in line 4.
Age,Attrition,BusinessTravel,DailyRate,Department,DistanceFromHome,Education,EducationField,EmployeeCount,EmployeeNumber,EnvironmentSatisfaction,Gender,HourlyRate,JobInvolvement,JobLevel,JobRole,JobSatisfaction,MaritalStatus,MonthlyIncome,MonthlyRate,NumCompaniesWorked,Over18,OverTime,PercentSalaryHike,PerformanceRating,RelationshipSatisfaction,StandardHours,StockOptionLevel,TotalWorkingYears,TrainingTimesLastYear,WorkLifeBalance,YearsAtCompany,YearsInCurrentRole,YearsSinceLastPromotion,YearsWithCurrManager
41,Yes,Travel_Rarely,1102,Sales,1,2,Life Sciences,1,1,2,Female,94,3,2,Sales Executive,4,Single,5993,19479,8,Y,Yes,11,3,1,80,0,8,0,1,6,4,0,5
49,No,Travel_Frequently,279,Research & Development,8,1,Life Sciences,1,2,3,Male,61,2,2,Research Scientist,2,Married,5130,24907,1,Y,No,23,4,4,80,1,10,3,3,10,7,1,7
37,Yes,Travel_Rarely,1373,Research & Development,2,2,Other,1,4,4,Male,92,2,1,Laboratory Technician,3,Single,2090,2396,6,Y,Yes,15,3,2,80,0,7,3,3,0,0,0,0
33,No,Travel_Frequently,1392,Research & Development,3,4,L
@ryanorsinger
ryanorsinger / numpy_exercises_part_1.py
Last active November 1, 2023 17:25
Numpy introduction
import numpy as np
# Life w/o numpy to life with numpy
## Setup 1
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# Use python's built in functionality/operators to determine the following:
# Exercise 1 - Make a variable called sum_of_a to hold the sum of all the numbers in above list
# Exercise 2 - Make a variable named min_of_a to hold the minimum of all the numbers in the above list
@ryanorsinger
ryanorsinger / pq_example.js
Created December 4, 2020 20:27
Example for providing guidance on questions for exercise numbers 43, 44, and 45 on the 101 Exercises
function isPorQ(string) {
// Lowercase our input so we're only comparing to "p" or "q"
string = string.toLowerCase();
// The || "or" operator here allows us to check if a value is one thing or another, and returns true if there's at least one match.
return string === "p" || string === "q";
}
// hasPorQ with no loop
function hasPorQ(string) {
[
{
"quote": "We don't make mistakes, just happy little accidents.",
"author": "Bob Ross"
},
{
"quote": "Talent is a pursued interest. In other words, anything you are willing to practice, you can do.",
"author": "Bob Ross"
},
{
@ryanorsinger
ryanorsinger / examples.js
Last active December 3, 2022 21:22
Example Functions in JavaScript
// Example functions with comparison and logical operators
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#equality_operators
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#comparison_operators
// returns true or false if the input variable is greater than 2.
// 3 > 2 is true
// 2.01 > 2 is true
// 2 > 2 is false because 2 is not greater than 2
// 1 > 2 is false
function isGreaterThanTwo(x) {
@ryanorsinger
ryanorsinger / outline.md
Created December 3, 2022 17:27
JointProb group from SciCloj

What is Jointprob?

Jointprob is a probabilistic modelling and Bayesian statistics study group.

https://scicloj.github.io/docs/community/groups/jointprob/

Why is Scicloj organizing this Group

Scicloj is an open-source group working on a stack of tools and libraries for data science using the Clojure programming language.

A few of us care a lot about the probabilistic/Bayesian paradigm and find it a promising approach in general

@ryanorsinger
ryanorsinger / setup.md
Last active August 4, 2022 03:17
Installing rstan, cmdstan, and rethinking packages on a relatively fresh OS install.

Goal: Install rstan, cmdstan, and rethinking in order to work through Rethinking Statistics.

Computing Environment

  • MacOS Monterrey running on M1 chip
  • MacOS Big Sur running on an Intel chip
  • Existing dependencies:
    • Installed XCode command line tools with xcode-select --install.
    • I installed R, RStudio, and could install and run other R packages.

Problem: