Word Counter

Sat 17 May 2025

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


from collections import defaultdict
import re
content = """You know U make me wanna
You know U make me wanna
To start it off, I know you know me
To come to think of it, it was …

Category: basics

Read More

Word-Counter-Basic-1562

Sat 17 May 2025

title: "Word Counter" author: "Rj" date: 2019-05-20 description: "-" type: technical_note draft: false


from collections import defaultdict
import re
content = """You know U make me wanna
You know U make me wanna
To start it off, I know you know me
To come to think of it, it was only last …

Category: basics

Read More

Word To Chars

Sat 17 May 2025

title: "Word to Chars" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


word = "Toronto"
word
'Toronto'
type(word)
str
letters = word.split()
type(letters)
list
for l in letters:
    print(l, type(l))
Toronto <class 'str'>
len(letters)
1
chars = list(word)
type(chars)
list
for c …

Category: basics

Read More

Xml-File-To-Dict

Sat 17 May 2025

title: "XML File to Dictionary" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import xmltodict
import pprint
import json
with open('sample.xml') as fd:
    doc1 = xmltodict.parse(fd.read())
doc1
OrderedDict([('note',
              OrderedDict([('to', 'Tove'),
                           ('from', 'Jani'),
                           ('heading', 'Reminder'),
                           ('body', "Don't forget me this weekend …

Category: basics

Read More

Xml-To-Dict

Sat 17 May 2025

title: "XML to Dictionary" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import xmltodict
import pprint
import json
xml_content = """
     <note>
       <to>Tove</to>
       <from>Jani</from>
       <heading>Reminder</heading>
       <body>Don't forget me this weekend!</body>
   </note>
"""
xml_content
"\n     <note>\n       <to>Tove</to>\n       <from …

Category: basics

Read More

Xml-To-Json

Sat 17 May 2025

title: "XML to JSON" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import xmltodict
import pprint
import json
xml_content = """
     <note>
       <to>Tove</to>
       <from>Jani</from>
       <heading>Reminder</heading>
       <body>Don't forget me this weekend!</body>
   </note>
"""
xml_content
"\n     <note>\n       <to>Tove</to>\n       <from …

Category: basics

Read More

Zzemp-Basics

Sat 17 May 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



Score: 5

Category: basics

Read More
Page 17 of 17

« Prev