Stack-Extra
title: "Stack Extra"
author: "Raja CSP Raman"
date: 2019-05-07
description: "-"
type: technical_note
draft: false
import tensorflow as tf
import os
# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.constant([
[1, 2],
[3, 4]
])
<tf.Tensor 'Const_4:0' shape=(2, 2) dtype=int32 …
Read More
Star-Plot
import numpy as np
import matplotlib.pyplot as plt
x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)
plt.subplot(111)
plt.scatter(x, y, s=500, c=z, marker=">")
plt.show()
Score: 0
Read More
Startswith
title: "String Startswith"
author: "Rj"
date: 2019-04-20
description: "List Test"
type: technical_note
draft: false
content = "Toronto is awesome"
content.startswith("Toronto")
Score: 0
Read More
Static-Decorator
title: "Static Decorator"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
class Example:
name = "Example"
@staticmethod
def static():
print("%s static() called" % Example.name)
class Offspring1(Example):
name = "Offspring1"
class Offspring2(Example):
name = "Offspring2"
@staticmethod
def static():
print("%s static() called" % Offspring2.name)
Read More
Static-On-The-Fly
title: "Static on the fly"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
class Mathematics:
def addNumbers(x, y):
return x + y
# create addNumbers static method
Mathematics.addNumbers = staticmethod(Mathematics.addNumbers)
print('The sum is:', Mathematics.addNumbers(5, 10))
Score: 5
Read More
Statistics-Simple
title: "Statistics Simple"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
print(statistics.mean(data))
print(statistics.median(data))
print(statistics.variance(data))
Score: 5
Read More
Statsmodel-Sample
title: "Stats Model Sample"
author: "Raja CSP Raman"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
import numpy as np
import statsmodels.api as sm
spector_data = sm.datasets.spector.load()
/Users/rajacsp/anaconda3/envs/py36/lib/python3.6/site-packages/statsmodels/datasets/utils.py:100: FutureWarning: arrays to stack must be …
Read More
Stemmer-With-Stopwords
title: "Stemmer with Stopwords"
author: "Rj"
date: 2019-04-21
description: "-"
type: technical_note
draft: false
from nltk.stem.snowball import SnowballStemmer
stemmer = SnowballStemmer("english")
print(stemmer.stem("having"))
stemmer2 = SnowballStemmer("english", ignore_stopwords = True)
print(stemmer2.stem("having"))
Score: 5
Read More
Stemming-And-Lemmatization
title: "Stemming and Lemmatization"
author: "Rj"
date: 2019-04-21
description: "-"
type: technical_note
draft: false
-
Stemming and Lemmatization are Text Normalization techniques in Natural Language Processing that are used to prepare text, words, and documents for further text processing.
-
Text normalization sometimes called as Word Normalization
-
Stemming in the process of keeping …
Read More
Stock-Graph
title: "Stock Graph"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
import matplotlib.pyplot as plt
import fix_yahoo_finance as yf
def show_stock(code):
data = yf.download(code,'2010-01-01','2018-09-01')
data.Close.plot()
plt.show()
[*********************100%***********************] 1 of 1 downloaded

[*********************100%***********************] 1 of 1 downloaded

Score …
Read More