Graph

Fri 14 November 2025

title: "Graph" 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'
graph = tf.get_default_graph()
graph.get_operations()
[]
a = tf.constant(2, name = "one")
operations = graph.get_operations()

operations

b = tf.constant …

Category: tensorflow-work

Read More

Grid-Search-Sample

Fri 14 November 2025

title: "Grid Search Sample" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


from __future__ import print_function

from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classification_report
from sklearn.svm import SVC
# print(__doc__)

# Loading the Digits dataset
digits = datasets.load_digits …

Category: sklearn

Read More

Gruopby Date

Fri 14 November 2025

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


from datetime import datetime
import pandas as pd
data = {
    'date' : [
        '2019-05-01 19:47:05.069722', 
        '2019-05-02 17:47:05.069722', 
        '2019-05-02 19:47:05.069722',
        '2019-05-03 18:47:05.069722',
        '2019-05-03 19:47:05.069722',
    ],
    'spent …

Category: data-wrangling

Read More

Hay-1

Fri 14 November 2025
# https://haystack.deepset.ai/integrations/ollama
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312; pyv: 3.12.8 | packaged by Anaconda, Inc. | (main, Dec 11 2024, 16:31:09) [GCC 11.2.0]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack==2.1.1
python-dotenv==0 …

Category: haystack

Read More

Height-Vs-Weight

Fri 14 November 2025
!python --version
Python 3.10.5
# !pip install seaborn
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
data = {
    "Height": [150, 160, 165, 170, 175, 180, 185],
    "Weight": [50, 60, 65, 70, 75, 80, 85],
    "Gender": ["Female", "Male", "Female", "Male", "Female", "Male", "Female"]
}
df = pd.DataFrame …

Category: seaborn

Read More

Henon-Map

Fri 14 November 2025

from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
from bokeh.models import ColumnDataSource
# Set Bokeh output to notebook
output_notebook()

Category: bokeh

Read More

Hex-Validator

Fri 14 November 2025

import re

def is_valid_hex_color(color):
    pattern = r'^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$'
    return bool(re.match(pattern, color))

# Examples
print(is_valid_hex_color("#FFF"))  # True
print(is_valid_hex_color("#123ABC"))  # True
print(is_valid_hex_color("#123ABCG"))  # False
True
True
False
!pip show webcolors | grep "Version:"
Version: 24.11.1

import webcolors

def is_valid_hex_color(color):
    try:
        webcolors.hex_to_rgb …

Category: basics

Read More

Histogram

Fri 14 November 2025

title: "Histogram" author: "Rj" date: 2019-05-06 description: "List Test" type: technical_note draft: false


import numpy as np
import matplotlib.pyplot as plt
np.random.seed(13)
arr_data = np.random.normal(0,1, 100)
yhist, binedges = np.histogram(arr_data)
bincenters = np.mean(np.vstack([binedges[0:-1],binedges[1:]]), axis=0 …

Category: plot

Read More

Holmes-Map

Fri 14 November 2025

from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
from bokeh.models import ColumnDataSource
# Set Bokeh output to notebook
output_notebook()

Category: bokeh

Read More

Horizontal-Bar

Fri 14 November 2025
# http://matplotlib.org/1.2.1/examples/pylab_examples/barh_demo.html
import numpy as np
import pylab as pl
import matplotlib.pyplot as plt


val = [4, 6, 21]
pos = np.arange(len(val)) + .5    # the bar centers on the y axis

pl.figure(1)
plt.barh(pos, val, align='center')
plt …

Category: barchart

Read More
Page 107 of 146

« Prev Next »