Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import numpy as np
class StockPrices:
# param prices dict of string to list. A dictionary containing the tickers of the stocks, and each tickers daily prices.
# returns list of strings. A list containing the tickers of the two most correlated stocks.
@staticmethod
def most_corr(prices):
data=pd.DataFrame.from_dict(prices)
au_corr=data.corr()
import numpy as np
from sklearn import linear_model
class MarketingCosts:
# param marketing_expenditure list. Expenditure for each previous campaign.
# param units_sold list. The number of units sold for each previous campaign.
# param desired_units_sold int. Target number of units to sell in the new campaign.
# returns float. Required amount of money to be invested.
@staticmethod
SELECT name
FROM employees
where id NOT IN (
SELECT managerId FROM employees where managerId is not null
)
@UMU18
UMU18 / SQL DE #1
Last active January 22, 2019 08:38
SELECT COUNT(id) FROM students where firstName='John'
test case for deposit-interest (https://www.testdome.com/questions/quality-assurance/deposit-interest/19735?visibility=17&skillId=83)
#Test Case | DEPOSIT | AGE | INTEREST RATE
_________________|___________________|_______________|__________________
1 | 99 | 18 | Unavailable
2 | 10001 | 18 | Unavailable
3 | 100 | 18 | 1.0%
4 | 999 | 18 | 1.0%
5 | 1000 | 18 | 1.3%
6 | 4999 | 18 | 1.3%
<?php
//answer for https://www.testdome.com/questions/php/file-owners/11840?visibility=17&skillId=5
class FileOwners
{
public static function groupByOwners($files)
{
$result=array();
foreach($files as $key=>$value)
{
$result[$value][]=$key;