Lorenz-Similar-1

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

Magicattr-Sample

Fri 14 November 2025

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


import magicattr
class City:

    def __init__(self, name, country):
        self.name = name
        self.country = country
to = City('Toronto', 'Canada')
ch = City('Chennai', 'India')
print(to)
<__main__.City object at 0x10f2f8be0>
print(magicattr.get(to, 'country'))
Canada

Score …

Category: basics

Read More

Male-Vs-Female

Fri 14 November 2025
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt

objects = ('Male', 'Female')
y_pos = np.arange(2)
values = [10,8]

plt.bar(y_pos, values, width=0.12, align='center', alpha=0.2)
plt.xticks(y_pos, objects)
plt.ylabel('Usage')
plt.title('Male vs Female …

Category: barchart

Read More

Match-All-String

Fri 14 November 2025

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


one = "Toronto is nice"
one
'Toronto is nice'
one_array = one.split(" ")
two = "It is nice to be in Toronto"
two_array = two.split(" ")
two_array
['It', 'is', 'nice', 'to', 'be', 'in', 'Toronto']
all(x in two for …

Category: basics

Read More

Max-As-New-Column

Fri 14 November 2025

title: "Max as a New Column" author: "Rj" date: 2019-04-22 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.read_csv('abc.csv')
df
student language science …

Category: data-wrangling

Read More

Min-Max-Avg-As-New-Columns

Fri 14 November 2025

title: "Min Max Avg as new Columns" author: "Rj" date: 2019-04-22 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.read_csv('abc.csv')
df
student language …

Category: data-wrangling

Read More

Mistral-Llm-Translator

Fri 14 November 2025
# https://chatgpt.com/share/6767b5fc-cc44-8002-a0f1-68f486d27d9a
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
# !pip install sacremoses
print(pyu.ps2("transformers torch sacremoses"))
transformers==4.47.0
torch==2.5.1
sacremoses==0.0.53 …

Category: mythraki

Read More

Ml-Tips

Fri 14 November 2025

title: "ML Tips" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


Pandas builds on numpy arrays to provide rich data structures and data analysis tools.

Pandas.DataFrame function provides labelled arrays of data, similar to the R's "data.frame"

The pandas.read_csv() function can be used to …

Category: tips

Read More

Modify String In Place

Fri 14 November 2025

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


import io
s = "Toronto is awesome"
sio = io.StringIO(s)
print(sio.getvalue())
Toronto is awesome
sio.seek(11)
sio.write("Wonderful")
9
print(sio.getvalue())
Toronto is Wonderful


Score: 5

Category: basics

Read More
Page 115 of 146

« Prev Next »