Numpy Multiplication In Tensorflow

Fri 14 November 2025

title: "Numpy Multplication in Tensorflow" 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'
matrix1 = tf.constant([[3., 3.0]])
matrix2 = tf.constant([[2.0],[2.0]])
product = tf …

Category: tensorflow-work

Read More

Odd-Even-2

Fri 14 November 2025


def odd_even():
    for i in range(10):      
        if i % 2 == 0:
              print(f"The number {i} is even")
        else:
            print(f"The number {i} is odd")
odd_even()
The number 0 is even
The number 1 is odd
The number 2 is even
The number 3 is odd
The number 4 …

Category: assignments

Read More

Odd-Or-Even

Fri 14 November 2025

Nov 20 2024

Write a Python program that checks if a given number is odd or even.

def check_odd_or_even(input_number):

    if input_number % 2 == 0:
        return f"{input_number} is Even"

    return f"{input_number} is Odd"
check_odd_or_even(7)
'7 is Odd'
check_odd_or_even(8)
'8 is Even'
check_odd_or_even(0)
'0 is Even'
check_odd_or_even …

Category: assignments

Read More

On-Balance-Volume

Fri 14 November 2025
# Created: 20250103
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'
print(pyu.ps2("requests"))
requests==2.32.3
import yfinance as yf
import pandas as pd
import numpy as …

Category: stockmarket

Read More

Ones

Fri 14 November 2025

title: "Ones" 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.ones([2, 5])
a
<tf.Tensor 'ones:0' shape=(2, 5) dtype=float32>
with tf.Session …

Category: tensorflow-work

Read More

Online Image Reader

Fri 14 November 2025

title: "Online Image Reader" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


from PIL import Image
import numpy as np
import urllib.request
image_path = 'https://multimedia.bbycastatic.ca/multimedia/products/500x500/107/10736/10736343.jpg'
with urllib.request.urlopen(image_path) as url:
    with open('temp.jpg', 'wb …

Category: image-analysis

Read More

Online Image Reader-2

Fri 14 November 2025

title: "Online Image Reader 2" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import requests
from PIL import Image
from io import BytesIO
url = 'https://www.cognex.com/BarcodeGenerator/Content/images/isbn.png'
response = requests.get(url)
img = Image.open(BytesIO(response.content))
img

png

type(img)
PIL …

Category: image-analysis

Read More

Online Image To Array

Fri 14 November 2025

title: "Online Image to Array" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


from PIL import Image
import numpy as np
import urllib.request
image_path = 'https://multimedia.bbycastatic.ca/multimedia/products/500x500/107/10736/10736343.jpg'
with urllib.request.urlopen(image_path) as url:
    with open('temp.jpg …

Category: image-analysis

Read More

Ontario-Postal-Code

Fri 14 November 2025

title: "Ontario Postal Code" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


import re
names = ['M2N1H5', 'M2N 1H5', 'M882J8']

regex_patten = "^[A-Z]\d[A-Z]\s*\d[A-Z]\d"
# starts with Capital letter; it can have zero or one space

for name in names:
    m = re.match(regex_patten, name …

Category: regex

Read More

Pandas Version

Fri 14 November 2025

title: "Pandas Version" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false


import pandas as pd
pd.__version__
'0.24.2'
pd.show_versions(as_json=False)
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.8.final.0
python-bits: 64
OS: Darwin
OS-release: 18.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL …

Category: data-wrangling

Read More
Page 118 of 146

« Prev Next »