Stack-Extra

Fri 14 November 2025

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]
])
a
<tf.Tensor 'Const_4:0' shape=(2, 2) dtype=int32 …

Category: tensorflow-work

Read More

Star-Plot

Fri 14 November 2025

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

Category: barchart

Read More

Startswith

Fri 14 November 2025

title: "String Startswith" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


content = "Toronto is awesome"
content.startswith("Toronto")
True


Score: 0

Category: basics

Read More

Static-Decorator

Fri 14 November 2025

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)
Example.static()
Example static() called
Offspring1 …

Category: basics

Read More

Static-On-The-Fly

Fri 14 November 2025

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))
The sum is: 15


Score: 5

Category: basics

Read More

Statistics-Simple

Fri 14 November 2025

title: "Statistics Simple" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import statistics
data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
print(statistics.mean(data))
1.6071428571428572
print(statistics.median(data))
1.25
print(statistics.variance(data))
1.3720238095238095


Score: 5

Category: basics

Read More

Statsmodel-Sample

Fri 14 November 2025

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 …

Category: statsmodel

Read More

Stemmer-With-Stopwords

Fri 14 November 2025

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"))
have
stemmer2 = SnowballStemmer("english",  ignore_stopwords = True)
print(stemmer2.stem("having"))
having


Score: 5

Category: textprocessing

Read More

Stemming-And-Lemmatization

Fri 14 November 2025

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 …

Category: textprocessing

Read More

Stock-Graph

Fri 14 November 2025

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()
show_stock('INFY')
[*********************100%***********************]  1 of 1 downloaded

png

show_stock('AMZN')
[*********************100%***********************]  1 of 1 downloaded

png


Score …

Category: basics

Read More
Page 134 of 146

« Prev Next »