Skip to content

Instantly share code, notes, and snippets.

View toyeiei's full-sized avatar
🎯
Focusing

Kasidis Satangmongkol toyeiei

🎯
Focusing
View GitHub Profile
Year N.Amer Europe Asia S.Amer Oceania Africa Mid.Amer
1951 45939 21574 2876 1815 1646 89 555
1956 60423 29990 4708 2568 2366 1411 733
1957 64721 32510 5230 2695 2526 1546 773
1958 68484 35218 6662 2845 2691 1663 836
1959 71799 37598 6856 3000 2868 1769 911
1960 76036 40341 8220 3145 3054 1905 1008
1961 79831 43173 9053 3338 3224 2005 1076
{
"ID":["1","2","3","4","5","6","7","8" ],
"Name":["Rick","Dan","Michelle","Ryan","Gary","Nina","Simon","Guru" ],
"Salary":["623.3","515.2","611","729","843.25","578","632.8","722.5" ],
"StartDate":[ "1/1/2012","9/23/2013","11/15/2014","5/11/2014","3/27/2015","5/21/2013","7/30/2013","6/17/2014"],
"Dept":[ "IT","Operations","IT","HR","Finance","IT","Operations","Finance"]
}
<html>
<head>
<title>Welcome to our school website</title>
</head>
<body>
<h2>Our Innovative Teachers</h1>
<ul>
<li>Liam Nielson</li>
<li>Jack Dorsey</li>
<li>Reed Hastings</li>
@toyeiei
toyeiei / test_email.xml
Last active January 15, 2021 23:35
example email in XML format
<email>
<first>
<from>toy@datarockie</from>
<to>students@data-science-bootcamp.com</to>
<subject>Welcome to our course</subject>
<content>I hope you enjoy the class</content>
<date>16 January 2021</date>
</first>
<second>
<from>toy@datarockie</from>
## I've tried below codes and all failed the test
## none of these worked ..
stock = stock.drop_duplicates('item')
stock = stock.drop_duplicates('item').reset_index()
stock = stock.drop_duplicates('item').reset_index(drop=True)
stock = stock.drop_duplicates(['item'])
stock = stock.drop_duplicates(['item']).reset_index()
stock = stock.drop_duplicates(['item']).reset_index(drop=True)
stock = stock['item'].drop_duplicates()
stock = stock['item'].drop_duplicates().reset_index()
@toyeiei
toyeiei / techjam_data_prep.R
Last active November 22, 2019 23:24
TECHJAM 2019 data preparation
## -------------------------------------
## Import Libraries --------------------
## -------------------------------------
library(dplyr)
library(readr)
library(lubridate)
library(tidyr)
library(DescTools)
## load dataset
@toyeiei
toyeiei / kfold_regression.R
Created November 15, 2019 09:52
train linear regression in R using kfold method
## R version 3.6.1
## Created by DataRockie 15 November 2019
## load library
library(caret)
library(mlbench)
library(dplyr)
## load dataset
data("BostonHousing")
<html>
<head>
<title>This is my first webpage</title>
</head>
<body>
<h1>Hello World</h1>
<p>Let's learn web development in two months.</p>
</body>
</html>
@toyeiei
toyeiei / covariance_correlation.R
Last active September 3, 2019 01:12
cov cor r-squared in R
## create example data
x <- 1:20
y <- 35 + 5.5*x
## add some random noise to y
set.seed(99)
y <- y + rnorm(n = 20, mean = 2, sd = 5)
## create a data frame of xy
df <- data.frame(distance = x, fare = y)
@toyeiei
toyeiei / excel_data_transformation.R
Last active August 15, 2019 08:34
R4Excel - data transformation
## select columns
df %>%
select(id, student_name, gender)
## filter rows
df %>%
select(id, student_name, gender) %>%
filter(gender == "M")
## sample rows n=30