Skip to content

Instantly share code, notes, and snippets.

View catslovedata's full-sized avatar

Yagni Taggart catslovedata

  • self-representing
  • leaning against a wall of rain, aerial held high, calling "come on thunder!"
View GitHub Profile
@catslovedata
catslovedata / MyScript.sql
Created September 5, 2020 17:35
A sql script type thing
select top 10 * from Person.Person
@catslovedata
catslovedata / 20CatsSample.csv
Last active September 6, 2020 11:27
Sample data - Cats Gender, Weight and Date of Birth
ID Name Gender Weight DateOfBirth
1 Leo Male 5.1 2015-06-12
2 Max Male 4.8 2017-08-18
3 Oliver Male 5.4 2016-08-28
4 Sooty Male 5.3 2014-10-23
5 George Male 5.2 2014-05-16
6 Felix Male 5.3 2018-08-25
7 Alfie Male 4.9 2014-08-19
8 Jasper Male 5.1 2018-07-29
9 Tigger Male 5.0 2018-09-07
@catslovedata
catslovedata / 20CatsSample.sql
Last active September 6, 2020 11:28
Populate sample data - Cats Gender, Weight and Date of Birth
CREATE TABLE [dbo].[CatDetails](
[ID] [int] NOT NULL,
[Name] [nvarchar](50) NOT NULL,
[Gender] [nvarchar](50) NOT NULL,
[Weight] [decimal](3, 1) NULL,
[DateOfBirth] [date] NULL
)
GO
INSERT [dbo].[CatDetails] ([ID], [Name], [Gender], [Weight], [DateOfBirth])
VALUES
hello
something new I created as a test
import numpy as np
from scipy.stats import norm, skewnorm
from matplotlib import pyplot as plt
RANDOM_SEED = 128 # Set to None if it should differ each time. RANDOM_SEED = None
NUM_VALUES = 10000 # Number of values to generate
MEAN, ST_DEV = 12, 2 # Mean and std dev to use in the normal distribution
NUM_BINS = 20 # Number of bins to group the data into
# Normal distribution
data1 = norm.rvs(loc=MEAN, scale=ST_DEV, size=NUM_VALUES, random_state=RANDOM_SEED)
data_binned1 = np.histogram(data1, bins=NUM_BINS)
x_values1 = data_binned1[1][:-1] # Boundary values - omit the last so that we have just the left boundaries.
y_values1 = data_binned1[0] # Count of items in this bin.
data1_min, data1_q1, data1_median, data1_q3, data1_max, data1_mean = np.min(data1), np.quantile(data1, 0.25), np.quantile(data1, 0.5), np.quantile(data1, 0.75), np.max(data1), np.mean(data1)
# Positive skew (alpha = 5)
data2 = skewnorm.rvs(5, loc=MEAN, scale=ST_DEV, size=NUM_VALUES, random_state=RANDOM_SEED)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.