code stringlengths 3 6.57k |
|---|
mplw.ax.clear() |
mplw.figurecanvas.draw() |
print("Too many clusters selected for cluster histogram") |
np.where(nids == unid) |
points.append(X[sidis]) |
points.append(np.ascontiguousarray(X[sidis]) |
time.time() |
util.NDsepmetric(*points, Nmax=20000) |
print('NDsep calc took %.3f sec' % (time.time() |
np.median(points[0], axis=0) |
np.median(points[1], axis=0) |
np.linalg.norm(line) |
print('c0=%r, c1=%r, line=%r' % (c0, c1, line) |
np.zeros(ndims) |
projs.append(np.dot(cpoints-c0, line) |
np.median(projs[1]) |
np.median(projs[0]) |
max(projs[0].std() |
std() |
print('std0=%f, std1=%f, d=%f' % (projs[0].std() |
std() |
np.concatenate(projs) |
max(intround(np.sqrt(len(proj) |
print('nbins = %d' % nbins) |
np.histogram(proj, bins=nbins) |
range(nclusters) |
hists.append(np.histogram(projs[i], bins=edges) |
np.concatenate([hists]) |
np.asarray([ h.sum() |
masses.argsort() |
hist.min(axis=0) |
sum() |
core.DJS(hists[0], hists[1]) |
len(ledges) |
a.clear() |
list(unids) |
print(windowtitle) |
mplw.setWindowTitle(windowtitle) |
sqrt(DJS) |
np.sqrt(djs) |
print(title) |
a.set_title(title) |
enumerate(cs) |
a.bar(ledges, hist[i], width=binwidth, color=cs[i], edgecolor=cs[i]) |
mplw.f.tight_layout(pad=0.3) |
mplw.figurecanvas.draw() |
MyBot(sc2.BotAI) |
on_step(self, iteration) |
repr(x) |
self._client.send_debug() |
main() |
run_game(maps.get("Abyssal Reef LE") |
Bot(Race.Terran, MyBot() |
Computer(Race.Protoss, Difficulty.Medium) |
main() |
print (dir(gutenberg) |
print (gutenberg.fileids() |
gutenberg.fileids() |
gutenberg.raw(file_id) |
print (len(text) |
listToString(s) |
pd.DataFrame() |
while (sampNum < 186) |
open("sample"+str(sampNum) |
fileOpen.readlines() |
listToString(temp) |
PunktTrainer() |
trainer.train(text) |
PunktSentenceTokenizer(trainer.get_params() |
tokenizer._params.abbrev_types.add('dr') |
tokenizer.tokenize(temp) |
Analyzer (SIA) |
SIA() |
sent_df.iterrows() |
sia.polarity_scores(line) |
score.get('neg') |
score.get('neu') |
score.get('pos') |
score.get('compound') |
pprint(results[:10], width=100) |
sent_df.head() |
sent_df.to_csv('sentiment analysis.csv', mode='a', encoding='utf-8', index=False) |
print("Positive headlines:\n") |
pprint(list(sent_df[sent_df['label'] == 1].sent) |
print("\nNegative headlines:\n") |
pprint(list(sent_df[sent_df['label'] == -1].sent) |
print(sent_df.label.value_counts() |
print(sent_df.label.value_counts(normalize=True) |
plt.subplots(figsize=(8, 8) |
sent_df.label.value_counts(normalize=True) |
sns.barplot(x=counts.index, y=counts, ax=ax) |
ax.set_xticklabels(['Negative', 'Neutral', 'Positive']) |
ax.set_ylabel("Percentage") |
plt.show() |
sent_df.iterrows() |
len(sentence.split() |
sent_df.iterrows() |
strip_non_alphanum(str(temp) |
strip_punctuation(temp1) |
strip_multiple_whitespaces(temp2) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.