Numpy Multiplication In Tensorflow
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 …
Read More
Odd-Even-2
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")
The number 0 is even
The number 1 is odd
The number 2 is even
The number 3 is odd
The number 4 …
Read More
Odd-Or-Even
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"
Read More
On-Balance-Volume
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"))
import yfinance as yf
import pandas as pd
import numpy as …
Read More
Ones
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'
<tf.Tensor 'ones:0' shape=(2, 5) dtype=float32>
Read More
Online Image Reader
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 …
Read More
Online Image Reader-2
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))

Read More
Online Image To Array
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 …
Read More
Ontario-Postal-Code
title: "Ontario Postal Code"
author: "Raja CSP Raman"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
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 …
Read More
Pandas Version
title: "Pandas Version"
author: "Rj"
date: 2019-04-24
description: "-"
type: technical_note
draft: false
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 …
Read More