This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date | |
import pandas as pd | |
import random | |
import numpy as np | |
import KC | |
import matplotlib.pyplot as plt | |
today = date.today() | |
current_date = today.strftime("%b-%d-%Y") | |
windowSize = 11 #This is the length of a "good data" string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[7.0, 8.1, 7.0, 7.0, 9.3, 7.0, 8.1, 9.3, 7.0, 7.0, 7.0, 5.8, 7.0, 8.1, 9.3, 7.0, 8.1, 7.0, 5.8, 9.3, 5.8, 7.0, 7.0, 8.1, 8.1, 7.0, 8.1, 2.3, 7.0, 5.8, 8.1, 2.3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy.core import numeric | |
import pandas as pd | |
import random | |
# from random import randrange | |
import numpy as np | |
import KC | |
import matplotlib.pyplot as plt | |
windowSize = 10 #This is the length of a "good data" string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const router = express.Router(); | |
const fs = require('fs'); | |
const path = require('path'); | |
const sqlite3 = require('sqlite3').verbose(); | |
const db = new sqlite3.Database(path.join(__dirname, '../db/development.sqlite3')); | |
function sleep(time) { | |
const stop = new Date().getTime(); | |
while(new Date().getTime() < stop + time) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import KC | |
import matplotlib.pyplot as plt | |
windowSize = 5 #This is the length of a "good data" string | |
num_of_dots_allowed = 0 #How many dots are allowed in the "good data" | |
step = 1 #How many data points we skip (granulate the data) | |
fileName = "/Users/rafiqkamal/Desktop/Data_Science/timeSeries/Energy and Mining 50 series 200 plus entities World Bank.xlsx"#insert file name here | |
originalData = pd.read_excel(fileName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Spyder Editor | |
This is a temporary script file. | |
""" | |
from matplotlib import pyplot as plt | |
import math | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
import math | |
import re | |
import heapq | |
from scipy.spatial.distance import hamming | |
import statistics | |
f = open("/Users/rafiqkamal/Desktop/Data_Science/RNAProject210110/RNAL20StructuresGSSizes.txt") | |
contents = f.readlines() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
We have to find the longest substring of identical characters in a very long string. | |
Let's see an example: | |
s1 = "1111aa994bbbb1111AAAAAFF?<mmMaaaaaaaaaaaaaaaaaaaaaaaaabf" | |
The longest substring in s1 is "aaaaaaaaaaaaaaaaaaaaaaaaa" having a length of 25, made of character, "a", with its corresponding ascii code equals to "97", and having its starting index 29 and the ending one 53. | |
We express the results using an array in the following order: ["97", 25, [29,53]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I have an error with the 44 argument. I think it has something to do with lines 24 to 27 where the logic is getting messed up due to it being such a small string. We may be able to just add another piece of logic to the if statement on line 22, but I am not sure what I would add. | |
I know I can solve this more simply by changing the numbers to a string and comparing the first of the string to the second half of the string, but I chose to use two pointers because it is more robust due to the fact that it can handle all character types which is why I want to use it. | |
INSTRUCTIONS: | |
A double number is an even-length number whose left-side digits are exactly the same as its right-side digits. For example, 44, 3333, 103103, and 7676 are all double numbers, whereas 444, 334433, and 107 are not. | |
Write a function that returns the number provided as an argument multiplied by two, unless the argument is a double number; return double numbers as-is. | |
*/ |