House-Sales

Fri 14 November 2025
# !pip install kaggle
# https://medium.com/@pumaline/easy-analysis-of-your-data-and-ml-model-using-evidently-ai-830ef0c1c4fd
# https://xgboost.readthedocs.io/en/latest/python/python_api.html
import pandas as pd
df = pd.read_csv('~/datasets/kaggle/kc_house_data.csv')
df.head()
id date …

Category: evidentlyai

Read More

Hub Runnable-1

Fri 14 November 2025

8
How to: add message history (memory) to a chain
https://python.langchain.com/docs/how_to/message_history/

!python --version
Python 3.12.4
from constants import OPENAI_API_KEY
!pip show langchain-openai | grep "Version:"
Version: 0.2.9
import os
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
from langchain_openai import ChatOpenAI

model = ChatOpenAI(model …

Category: langchain

Read More

Hybrid-Gliner

Fri 14 November 2025
import re
from gliner import GLiNER
# Initialize GLiNER with a pre-trained model
model = GLiNER.from_pretrained("urchade/gliner_medium-v2.1")  # Replace with a location-specific model if available
Fetching 5 files:   0%|          | 0/5 [00:00<?, ?it/s]


/home/rajaraman/miniconda3/envs/ml312/lib/python3.12/site-packages/transformers/convert_slow_tokenizer.py:562: UserWarning …

Category: gliner

Read More

If-Else-Pandas

Fri 14 November 2025

title: "If Else Pandas" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false source: http://pandas.pydata.org/pandas-docs/version/0.24/user_guide/cookbook.html#idioms


import numpy as np
import pandas as pd
df = pd.DataFrame({
    'maths' : [80, 89, 90, 20],
    'science' : [40, 50, 90, 100],
    'language' : [20, 30 …

Category: data-wrangling

Read More

If Then

Fri 14 November 2025

title: "Template" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false source: http://pandas.pydata.org/pandas-docs/version/0.24/user_guide/cookbook.html#idioms


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

Category: data-wrangling

Read More

Ikeda-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

Iloc

Fri 14 November 2025

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


import pandas as pd
df = pd.read_csv('data1.csv', sep=',', header=None)
df
0 1 2
0 capacity score length …

Category: data-wrangling

Read More

Iloc-Position-Slice

Fri 14 November 2025

title: "iLoc Position Slice" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.read_csv('data1.csv')
df
capacity score length
0 1 …

Category: data-wrangling

Read More

Image-With-Matplot

Fri 14 November 2025
!python --version
Python 3.10.5
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# Path to your PNG file
image_path = 'deer.jpg'
# Load and display the image
img = mpimg.imread(image_path)
plt.imshow(img)
plt.axis('off')  # Turn off axis
plt.show()

png



Score: 5

Category: image-work

Read More

Immutable-Int

Fri 14 November 2025

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


a = 12

dictionary = {
  "one": a
}
a
12
dictionary
{'one': 12}
a += 9
a
21
dictionary
{'one': 12}

int is immutable, that's why you can't see the dictionary value changed

Here you are assigning to key 'a' …

Category: basics

Read More
Page 108 of 146

« Prev Next »