Skip to content

Instantly share code, notes, and snippets.

View toyeiei's full-sized avatar
🎯
Focusing

Kasidis Satangmongkol toyeiei

🎯
Focusing
View GitHub Profile
@toyeiei
toyeiei / example_csv_sheets.csv
Created November 17, 2022 23:04
Example data for google sheets course
id name city
1 John London
2 Mary London
3 Anna Reading
4 Kevin Reading
5 Liam Manchester
@toyeiei
toyeiei / web_scraping_specphone.r
Created November 14, 2022 07:45
datarockie blog - web scraping specphone example
library(tidyverse)
library(rvest)
url <- "https://specphone.com/Samsung-Galaxy-S22.html"
web <- read_html(url)
topics <- web %>%
html_nodes("div.topic") %>%
html_text()
@toyeiei
toyeiei / model_r_20221105.R
Created November 5, 2022 05:16
Regression modeling in R
library(caret)
model <- train(mpg ~ ., data = mtcars, method = "lm")
print(model)
@toyeiei
toyeiei / sqlite_create_db.sql
Created September 20, 2022 10:13
blog - create a new database in sqlite
.open pizzas.db
-- drop table pizza;
CREATE TABLE pizza (
id int,
name text,
calorie int,
price real
);
@toyeiei
toyeiei / r_example_dataframe.csv
Created September 14, 2022 03:16
R example dataframe for datarockie blog
id customer_names customer_ages customer_country
1 Lisa 24 Thailand
2 Jisoo 25 Korea
3 Jenny 24 Korea
4 Rose 26 Korea
5 Hana 28 China
@toyeiei
toyeiei / streamlit_app_new.py
Last active September 8, 2022 02:39
streamlit_basic_app_toy_2022SEP08
import streamlit as st
import pandas as pd
st.header("Hello World 👏")
st.write("This is my first app")
url = "https://raw.githubusercontent.com/mwaskom/seaborn-data/master/penguins.csv "
df = pd.read_csv(url)
df2 = df.groupby('species')['body_mass_g'].mean()
@toyeiei
toyeiei / streamlit_app.py
Last active September 7, 2022 16:20
streamlit_sample_app_2022SEP07
import streamlit as st
import pandas as pd
st.title('🎈 App Name')
st.sidebar.header("Input")
st.subheader("URL")
url = 'https://raw.githubusercontent.com/dataprofessor/data/master/iris.csv '
url_input = st.sidebar.text_input("URL:", url)
@toyeiei
toyeiei / simple_website_march2022.html
Last active March 30, 2022 11:30
simple website for intro to web scraping class
<!DOCTYPE html>
<html>
<head>
<title>DataRockie School</title>
</head>
<body>
<h1>Welcome to our intro to web scraping class</h1>
<p>Awesome work</p>
<div>
@toyeiei
toyeiei / volcano_example.csv
Created January 23, 2021 00:24
volcano dataset for ggplot raster
Var1 Var2 value
1 1 100
2 1 101
3 1 102
4 1 103
5 1 104
6 1 105
7 1 105
8 1 106
9 1 107
Year Region Sales
1951 N.Amer 45939
1951 Europe 21574
1951 Asia 2876
1951 S.Amer 1815
1951 Oceania 1646
1951 Africa 89
1951 Mid.Amer 555
1956 N.Amer 60423
1956 Europe 29990