Skip to content

Instantly share code, notes, and snippets.

View islandjoe's full-sized avatar

Arthur Kho islandjoe

  • Helsinki, Finland
View GitHub Profile
@islandjoe
islandjoe / hyberabad.csv
Created December 6, 2021 13:57
Data for house prices in Hyberabad
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 40 columns, instead of 1. in line 7.
Price,Area,Location,No. of Bedrooms,Resale,MaintenanceStaff,Gymnasium,SwimmingPool,LandscapedGardens,JoggingTrack,RainWaterHarvesting,IndoorGames,ShoppingMall,Intercom,SportsFacility,ATM,ClubHouse,School,24X7Security,PowerBackup,CarParking,StaffQuarter,Cafeteria,MultipurposeRoom,Hospital,WashingMachine,Gasconnection,AC,Wifi,Children'splayarea,LiftAvailable,BED,VaastuCompliant,Microwave,GolfCourse,TV,DiningTable,Sofa,Wardrobe,Refrigerator
6968000,1340,Nizampet,2,0,0,1,1,1,1,1,1,0,1,0,0,1,0,1,1,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0
29000000,3498,Hitech City,4,0,0,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0
6590000,1318,Manikonda,2,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0
5739000,1295,Alwal,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0
5679000,1145,Kukatpally,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0
6099000,1230,Nizampet,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0
70
@islandjoe
islandjoe / earthquake_data.csv
Created December 4, 2021 06:19
id, flag_tsunami, year, month, day, hour, minute, second, focal_depth, eq_primary, eq_mag_mw, eq_mag_ms, eq_mag_mb, intensity, country, state, location_name, latitude, longitude, region_code, injuries, injuries_description, damage_millions_dollars, damage_description, total_injuries, total_injuries_description, total_damage_millions_dollars, tot…
We can't make this file beautiful and searchable because it's too large.
id,flag_tsunami,year,month,day,hour,minute,second,focal_depth,eq_primary,eq_mag_mw,eq_mag_ms,eq_mag_mb,intensity,country,state,location_name,latitude,longitude,region_code,injuries,injuries_description,damage_millions_dollars,damage_description,total_injuries,total_injuries_description,total_damage_millions_dollars,total_damage_description
338.0,No,1048.0,,,,,,,,,,,,UK,,UNITED KINGDOM: BRITIAN,52.0,,120,,,,,,,,
771.0,Tsu,1580.0,4.0,6.0,,,,33.0,6.2,,,,,UK,,UNITED KINGDOM: DOVER STRAITS,51.019,1.3090000000000002,120,,,,2,,,,
7889.0,Tsu,1757.0,7.0,15.0,,,,,,,,,,UK,,"UNITED KINGDOM: ENGLAND: ST. MARY, SCILLY ISLANDS",49.92,-6.32,120,,,,,,,,
6697.0,Tsu,1500.0,,,,,,,,,,,,USA,HI,HAWAII,,,150,,,,,,,,
6013.0,Tsu,1668.0,4.0,13.0,,,,,,,,,4.0,USA,MA,"BOSTON AND SALEM, MASSACHUSETTS",42.35,-71.05,150,,,,,,,,
5828.0,Tsu,1755.0,11.0,18.0,9.0,11.0,35.0,,7.0,,,,8.0,USA,MA,MASSACHUSETTS: EAST OF CAPE ANN,42.7,-70.3,150,,,,2,,,,
5927.0,Tsu,1788.0,8.0,6.0,,,,,8.0,,8.0,,,USA,AK,ALASKA PENINSULA,55.0,-161.0,150,,,,,,,,
7058.0,
@islandjoe
islandjoe / iris_data.csv
Created December 3, 2021 16:24
New Gist
sepal_length sepal_width petal_length petal_width species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
4.6 3.4 1.4 0.3 setosa
5.0 3.4 1.5 0.2 setosa
4.4 2.9 1.4 0.2 setosa
{
"Andorra": "AD",
"United Arab Emirates": "AE",
"Afghanistan": "AF",
"Antigua and Barbuda": "AG",
"Anguilla": "AI",
"Albania": "AL",
"Armenia": "AM",
"Angola": "AO",
"Antarctica": "AQ",
@islandjoe
islandjoe / fibonacci.py
Created July 5, 2021 16:31
Fibonacci Series in Python
def fibo(n):
prev = n - 2
current = n - 1
base_case = (n == 1 or n == 0)
return n if base_case else fibo(prev) + fibo(current)
for n in range(10):
print(fibo(n))
@islandjoe
islandjoe / odd-or-even
Created June 13, 2021 07:59
Python odd-even using bitwise operation
The classic code:
```
def odd_even(n):
if n % 2 == 0:
print('even')
else:
print('odd')
odd_even(13)
-> 'odd'
@islandjoe
islandjoe / numbers-list-min-avg-max
Created June 13, 2021 06:25
Python Exercises: Get the min, avg, and max of a list of numbers
figures = [79250913.5716, 48142828.4666, 41386999.2223, 93411238.6832, 15514669.4931, 70598005.1982, 33304295.9951, 75789282.3759, 74542259.467, 20922976.4366, 42697744.5193, 43535355.1567]
from statistics import median
min_stat, max_stat, avg_stat = min(figures), max(figures), median(figures)
print(f"min: {min_stat}\nmax: {max_stat}\navg: {avg_stat}")
min: 15514669.4931
max: 93411238.6832
avg: 45839091.81165
@islandjoe
islandjoe / length-of-word-in-list
Created June 13, 2021 05:48
Python iterable exercises: Get the length of each string elements in a list.
animals = ['Squirrel', 'Alligator', 'Shark', 'Panther', 'Donkey', 'Gnu', 'Echidna', 'Lark', 'Hornet', 'Dove', 'Dog', 'Sea lion']
## for-loop
animals_ = []
for animal in animals:
animals_.append(len(animal))
animals_
=> [8, 9, 5, 7, 6, 3, 7, 4, 6, 4, 3, 8]
@islandjoe
islandjoe / README.md
Last active December 3, 2021 16:23
fresh block
@islandjoe
islandjoe / .block
Last active November 19, 2020 11:50
fresh block
license: mit