Pydotplus-1

Fri 14 November 2025
from pydotplus import graphviz

# Example graph creation
graph = graphviz.Dot(graph_type='digraph')
node_a = graphviz.Node('A')
node_b = graphviz.Node('B')
graph.add_node(node_a)
graph.add_node(node_b)
graph.add_edge(graphviz.Edge(node_a, node_b))

# Save and visualize
graph.write_png("example_graph.png")
from IPython.display import Image
Image(graph.create_png())

png



Score: 0

Category: sklearn

Read More

Pylru-Cache

Fri 14 November 2025

title: "Pylru Cache" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import pylru
cache = pylru.lrucache(100)
cache
<pylru.lrucache at 0x112997fd0>
# add 
cache['name'] = 'One'
cache['name']
'One'
# add 
cache['city'] = 'Toronto'
'city' in cache # this doesn't affect the cache order
True
cache.keys()
<generator object lrucache …

Category: basics

Read More

Python-Division

Fri 14 November 2025

title: "Python Division" author: "TACT" date: 2019-04-20 description: "-" type: technical_note draft: false


a = 30
b = 6

c = a / b
print(c)
5.0


Score: 0

Category: basics

Read More

Python Path

Fri 14 November 2025

title: "Python Path" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import sys
print(sys.path)
['', '/Users/rajacsp/anaconda3/envs/py36/lib/python36.zip', '/Users/rajacsp/anaconda3/envs/py36/lib/python3.6', '/Users/rajacsp/anaconda3/envs/py36/lib/python3.6/lib-dynload', '/Users/rajacsp/anaconda3/envs/py36/lib/python3.6 …

Category: basics

Read More

Query-By-Name

Fri 14 November 2025

title: "Query By Name" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import os
import sys

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, ForeignKey, Integer, String
Base = declarative_base()
class City(Base):
    __tablename__ = 'city'
    # Here we …

Category: sqlalchemy

Read More

Query-With-Param

Fri 14 November 2025

title: "Query With Param" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import os
import sys

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, ForeignKey, Integer, String
Base = declarative_base()
class City(Base):
    __tablename__ = 'city'
    # Here we …

Category: sqlalchemy

Read More

Quick-Sort

Fri 14 November 2025

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


def quicksort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[len(arr) // 2]
    left = [x for x in arr if x < pivot]
    middle = [x for x in arr if x == pivot]
    right = [x for x …

Category: basics

Read More

Radar-Chart-Simple

Fri 14 November 2025

title: "Radar Chart Simple" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import matplotlib.pyplot as plt
import pandas as pd
from math import pi
df = pd.DataFrame({
    'group' : ['A', 'B', 'C', 'D'],

    'var1' : [10, 20, 30, 4],
    'var2' : [2, 88, 22, 2]
})
df

Category: plot

Read More

Radar-Simple-2

Fri 14 November 2025

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


# copied from https://python-graph-gallery.com/390-basic-radar-chart/

# Libraries
import matplotlib.pyplot as plt
import pandas as pd
from math import pi

# Set data
df = pd.DataFrame({
'group': ['A','B','C','D'],

'java': [38, 1.5, 30, 4 …

Category: plot

Read More

Radviz-Sample

Fri 14 November 2025

title: "Radviz Sample" author: "Raja CSP Raman" date: 2019-02-03 description: "-" type: technical_note draft: false


import pandas as pd
from yellowbrick.features import RadViz
def load_yb_data(name = 'occupancy'):
    folder_path = name+'/'+name
    return pd.read_csv('/Users/rajacsp/datasets/yb_data/'+(folder_path)+'.csv')
# Load the classification data set
data = load_yb_data("occupancy")
# Specify the features …

Category: yellowbrick

Read More
Page 122 of 146

« Prev Next »