Skip to content

Instantly share code, notes, and snippets.

View joyadauche's full-sized avatar

Joy Ada Uche joyadauche

View GitHub Profile
@joyadauche
joyadauche / 1.md
Last active December 30, 2020 17:16
Joins in SQL- OUTER JOINS
id name score year
33CC Zamani C 2020
33CC Zamani B 2019
44DD Ayo A 2020
44DD Ayo B 2019
55EE Ahmad null null
11AA Adebayo null null
22BB Chioma null null
@joyadauche
joyadauche / eda_part_a.py
Last active November 28, 2020 18:09
The AI Alpha Geek: It starts with EDA!
# import packages and set up
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
pd.set_option('display.width', None)
@joyadauche
joyadauche / 1.md
Last active July 30, 2020 16:24
The Math ML Maestro: Introducing Linear Algebra Applications

5x + 4y = 1

3x - 6y = 2

@joyadauche
joyadauche / 1.py
Last active June 29, 2020 17:41
The Big Data Bravura: Introducing Apache Spark
from pyspark import SparkConf, SparkContext
conf = SparkConf().setMaster("local").setAppName("SubjectsByClass")
sc = SparkContext(conf=conf)
def get_class_and_subject(entry):
fields = entry.split(',')
class_id = fields[1]
number_of_subjects = int(fields[2])
@joyadauche
joyadauche / 1.md
Last active May 31, 2020 19:17
The ML Maven: Introducing the Confusion Matrix

A confusion matrix example for earthquake happenings in Wakanda

Number of samples = 240

PREDICTED: NO: 0 PREDICTED: YES: 1 TOTAL
ACTUAL: NO: 0 60 20 80
ACTUAL: YES: 1 10 150 160
TOTAL 70 170
@joyadauche
joyadauche / 1.py
Last active April 30, 2020 16:28
The Data Viz Wiz: Introducing Matplotlib
import matplotlib.pyplot as plt
fig, ax = plt.subplots();
plt.show()
# equivalents to above - different ways of creating an axes
# 1a -
# ax = plt.subplot()
# plt.show()
# 1b -
@joyadauche
joyadauche / 1.py
Last active February 29, 2020 16:58
The Proficient Pythonista: List Comprehensions
numbers = [2, 9, 1, 4, 0]
new_numbers = []
for number in numbers:
new_numbers.append(number + 3)
print(new_numbers)
@joyadauche
joyadauche / 1.py
Last active March 1, 2020 20:19
Docs
x = [11, 12, 13, 14, 15]
y = [1, 2, 3, 4, 5]
print(x/y)
# python would throw an error for this
@joyadauche
joyadauche / 1.md
Last active March 31, 2020 15:56
The Pandas Pundit: Accessing Data in DataFrames

country table

code country capital population_millions
NG Nigeria Abuja 206
CA Canada Ottawa 37
BR Brazil Brasilia 211
CH China Beijing 1000
FR France Paris 11
@joyadauche
joyadauche / 10.sql
Last active January 2, 2020 16:24
Joins in SQL- INNER JOINS: complete code for joining Person, Grade and Activity Tables (refactored)
SELECT name, score, activity, a.year
FROM person AS p
INNER JOIN grade AS g
USING(id)
INNER JOIN activity AS a
USING(id, year)