Skip to content

Instantly share code, notes, and snippets.

View asheone's full-sized avatar
🏠
Working from home

Lukasz Aszyk asheone

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

I am asheone on github. I am asheone (https://keybase.io/asheone) on keybase. I have a public key ASCEu2Q86PL8dzcHtECvowGeGaoVL2IpzjOhuKmeJV7x9wo To claim this, I am signing this object:

{
  "body": {
@asheone
asheone / running_total.sql
Last active December 29, 2018 19:27
Calculating running total SQL
with data as
(
select
created_at::date as date,
count(posts)
from posts
group by 1
)
select
date,
@asheone
asheone / weekdays.sql
Created December 29, 2018 18:31
Weekdays SQL function
CREATE FUNCTION weekdays(date, date) RETURNS integer
AS 'select $1 - $2;'
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asheone
asheone / DecisionTreeAshe.m
Last active November 12, 2019 09:14
Decision Tree code in MatLab
clc
% Script written and validated in R2017b MatLab version(9.3.0.713579)
% Work of Lukasz Aszyk
%% Import data and store it in BankTable and TestData variables
% This are initial datasets provided by UCI. Further investigation led to
% own dataset separation given the fact the test dataset wasn't erased
% from training dataset which led to 100% accuracy in built models.
@asheone
asheone / table_transformation.R
Created January 3, 2018 00:21
R code for cleaning data frames
#Import useful libraries
library(stringr)
library(tidyr)
library(readr)
library(reshape2)
#Import data files and separate columns by tab:
emigration <- read_delim("~/Documents/szkola_uk/Visual Analytics/coursework/migr_emi2.tsv",
"\t", escape_double = FALSE)
immigration <- read_delim("~/Documents/szkola_uk/Visual Analytics/coursework/data/migr_imm8.tsv",
@asheone
asheone / calendar.py
Last active June 19, 2017 18:40
It's a calendar exercise **not finished** **has bugs to fix**
__author__ = 'actt811'
# noinspection PyPep8Naming
def printMonth(year, month):
return
def printMonthTitle(year, month):
print('')
@asheone
asheone / totalBrought.py
Created June 18, 2017 18:51
Total items brougth as dictonary exercise from Al Sweigart
allGuests = {'Alice': {'apples': 5, 'pretzels':12},
'Bob': {'ham sandwitches': 3, 'apples':2},
'Carol': {'cups': 3, 'apples pies': 1}}
def totalBrought(guests, item):
numBrought = 0
for k, v in guests.items():
numBrought = numBrought + v.get(item,0)
return numBrought
print('Number of things being brought: ')
@asheone
asheone / birthdays.py
Created June 18, 2017 16:45
Birthday dictonary database exercise from Al Sweigart
birthdays = {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
while True:
name = str(input('Enter a name: (blank to quit) '))
if name == '':
break
if name in birthdays:
print(birthdays[name] + ' is the birthday of ' + name)
else:
@asheone
asheone / heart.py
Last active June 16, 2017 13:48
This is the next exercise from Al Sweigart book
grid = [['.', '.', '.', '.', '.', '.'],
['.', '0', '0', '.', '.', '.'],
['0', '0', '0', '0', '.', '.'],
['0', '0', '0', '0', '0', '.'],
['.', '0', '0', '0', '0', '0'],
['0', '0', '0', '0', '0', '.'],
['0', '0', '0', '0', '.', '.'],
['.', '0', '0', '.', '.', '.'],
['.', '.', '.', '.', '.', '.']]
x = len(grid) - 1 # number of lines = 8