Skip to content

Instantly share code, notes, and snippets.

View gitUmaru's full-sized avatar
🤔
Pretending to understand what non-Euclidean data is

Umar Ali gitUmaru

🤔
Pretending to understand what non-Euclidean data is
View GitHub Profile
@gitUmaru
gitUmaru / Question7.ipynb
Last active October 15, 2023 01:44
scratch.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gitUmaru
gitUmaru / notebook.ipynb
Created June 11, 2022 03:01
Patient Readmission within 30 Days Prediction Model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gitUmaru
gitUmaru / colab_make_git_current_dir.sh
Created August 18, 2021 18:31
Colab Make Git Current Dir --- A simple bash script for Google Colabs (or bash systems) that removes the sample data and makes whatever git repo you are cloning into your permanent working dir. Essentially puts contents of git repo in /content/ instead of /content/git_repo/.
#!/bin/bash
rm -r ./sample_data/
git clone https://github.com/GIT_USER/GIT_REPO
find ./GIT_REPO/ -maxdepth 1 -mindepth 1 -exec mv {} . \;
rm -r ./GIT_REPO/
@gitUmaru
gitUmaru / model.py
Created February 24, 2021 20:48
Modelling Chemical Kinetics --- This short script simply models a very simple system of some chemical compound c_{A} and c_{B} that is constrained to c_{A}' = -c_{B}' = -k c_{A}. In other words, the first order chemical reaction is: A -> B. I am specifically modeling the kinetics of an isomerization reaction, the decay of 13-cis-retinal to all-t…
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# Something to note is that this is from the old API of scipy and its better to use their new solve_ivp() method instead.
# Define the chemical system and its kinetic constraints
def rxn(C,t):
Ca = C[0]
Cb = C[1]
@gitUmaru
gitUmaru / make_random_wave_data.py
Last active February 24, 2021 20:32
Noisy Data With Trend --- This short script simply generates some random wave data for testing wave analysis. I borrowed it from deeplearning.ai Coursera TensorFlow certificate. I specifically used this to test a MATLAB pipeline for determining displacement from accelerometer data.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
SAVE = False
def plot_series(time, series, format="-", start=0, end=None):
@gitUmaru
gitUmaru / split_data.py
Created September 19, 2020 21:21
Split Data Into Train and Test --- This is a general purpose script for data processing and machine learning that takes a large folder of data (organized in folder name) and sorts them according to what TensorFlow Image generator can use.)
# @author: gitUmarx`
import os
import zipfile
import random
from shutil import copyfile
def split_data(SOURCE, TRAINING, TESTING, SPLIT_SIZE):
"""
Function to split data from SOURCE into its respective TRAING and TESTING directories using the desired SPLIT_SIZE
@param: SOURCE - path to source dataset folder as String
@gitUmaru
gitUmaru / delete_files.py
Last active July 29, 2020 23:24
Delete certain files --- This very short python script simply deletes all files with a certain extension (or some other pattern). I took photos on a bike ride and the SD card was riddled with raw files and the JPG files; I only needed the JPG so this script removes any unwanted files.
import glob
import os
filenames = glob.glob('*.ARW')
for file in filenames:
os.remove(file)
print(file + " has been deleted, moving on to next file")
print("All files have been deleted, thank you")
@gitUmaru
gitUmaru / sms_send.py
Created April 19, 2020 22:20
Send email via Python --- This is a very simple script that I wrote several years ago that sends emails from your email to another persons email. As you can see this spams someone with email. Alternatively, one can automate email lists this way as well. Hypothetically, it can also serve as an SMS bomber, but I do not condone any malicious and mi…
import time
import smtplib
ep = 'smtp.gmail.com'
blue_spy = 'youremail@gmail.com'
pas = 'yourPassowrd'
port = 587
msg = 'The Lannisters send their regards'
red_spy = 'theirEmail@gmail.com'
server = smtplib.SMTP(ep,port)
@gitUmaru
gitUmaru / 1_BCA_Assay_abosrbance_heatmap.py
Last active August 17, 2020 03:18
Protein Absorbance Heatmap--- This makes a 2d density plot of your absorbance plot, attempting to show you what your data looks like. The first file visualizes the entire microwell plate, and the second file visualizes the entire plate AND experiemntal data/standards; making for better figures. BCA absorbance visualizer for assay.
import matplotlib.pyplot as plt
import numpy as np
from numpy import genfromtxt
import os
path = os.path.abspath("A3.csv")
def main():
X = genfromtxt(path,delimiter=',')
max = np.amax(X)
min = np.amin(X)