Sandp-Symbols

Fri 14 November 2025
# Created: 20250103
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"))
requests==2.32.3
import pandas as pd

# Download the list of S&P 500 …

Category: stockmarket

Read More

Scatter-Plot-Plotly

Fri 14 November 2025

title: "Scatter Plot - Plotly" author: "Rj" date: 2020-09-05 description: "Simple Plot on Plotly" type: technical_note draft: false


# x and y given as array_like objects
import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show()

Category: plotly

Read More

Seaborn-Flight-Data-Analysis

Fri 14 November 2025
# https://seaborn.pydata.org/generated/seaborn.lineplot.html
# https://rajacsp.github.io/mlnotes/python/data-wrangling/food_points/
import seaborn as sns
flights = sns.load_dataset("flights")
flights.head()
year month passengers
0 1949 Jan …

Category: plot

Read More

Seaborn-Pynotes-Growth

Fri 14 November 2025


# https://seaborn.pydata.org/installing.html
# https://stackabuse.com/seaborn-line-plot-tutorial-and-examples/
!pip show seaborn | grep "Version:"
Version: 0.13.2
# !pip install seaborn
import matplotlib.pyplot as plt
import seaborn as sns

sns.set_theme(style="darkgrid")

x = [
    0,
    220,
    380,
    500,
    540,
    540,
    590
]

sns.lineplot(x)
plt.show()

png



import pandas …

Category: plot

Read More

Search

Fri 14 November 2025

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


import re
data = [
    "name['toronto'] = 'One'",
    "state['ontario'] = 'Two'",
    "country['canada']['ca'] = 'Three'",
    "extra['maple'] = 'Four'"
]
REGEX = re.compile(r"\['(?P<word>.*?)'\]")
for line in data:
    found = REGEX.search(line)
    if found:
        print(found.group('word'))
toronto …

Category: regex

Read More

Search-Text

Fri 14 November 2025

title: "Search Text" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


from nltk.book import text1
*** Introductory Examples for the NLTK Book ***
Loading text1, ..., text9 and sent1, ..., sent9
Type the name of the text or sentence to view it.
Type: 'texts()' or 'sents()' to list the materials.
text1: Moby …

Category: textprocessing

Read More

Seconds2Timeformat

Fri 14 November 2025

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]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack is not installed in the current environment.
python-dotenv==0.21.0

def format_time(seconds):
    hours …

Category: basics

Read More

Select-All

Fri 14 November 2025

title: "Select All" 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 define …

Category: sqlalchemy

Read More

Select-Column-By-Index

Fri 14 November 2025

title: "Select Column By Index" 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 maths …

Category: data-wrangling

Read More

Sentiment

Fri 14 November 2025

title: "Twitter Sentiment Analysis" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import json
from pprint import pprint
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import urllib.request, json 
data = None
with urllib.request.urlopen …

Category: sentiment

Read More
Page 128 of 146

« Prev Next »