Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 AppBar from '@material-ui/core/AppBar'; | |
import Toolbar from '@material-ui/core/Toolbar'; | |
import useScrollTrigger from '@material-ui/core/useScrollTrigger'; | |
import makeStyles from '@material-ui/styles/makeStyles'; | |
import React from 'react'; | |
import { Tab } from '@material-ui/core'; | |
import Tabs from '@material-ui/core/Tabs'; | |
import Button from '@material-ui/core/Button'; | |
import { Link } from 'react-router-dom'; | |
import Menu from '@material-ui/core/Menu'; |
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
def showoff(ans): | |
shift = max(len(str(ans)), len(op[1]) + 1, len(op[0])) | |
print(op[0].rjust(shift)) | |
print((f + op[1]).rjust(shift), end=" \n") | |
print('-' *shift) | |
print(str(ans).rjust(shift)) | |
for _ in range(int(input())): | |
f = '' |
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
def high_precedence(a, b): | |
if b == '^': | |
return False | |
else: | |
if a in '/*' and b in '+-': | |
return True | |
else: | |
return False | |
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 | |
from sklearn.cluster import k_means | |
from scipy.spatial import distance | |
def compute_s(i, x, labels, clusters): | |
norm_c= len(clusters) | |
s = 0 | |
for x in clusters: | |
s += distance.euclidean(x, clusters[i]) |