This file contains hidden or 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 | |
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() |
This file contains hidden or 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 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 |
This file contains hidden or 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
SELECT name | |
FROM employees | |
where id NOT IN ( | |
SELECT managerId FROM employees where managerId is not null | |
) |
This file contains hidden or 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
SELECT COUNT(id) FROM students where firstName='John' |
This file contains hidden or 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
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% |
This file contains hidden or 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
<?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; |