Adjective-Collector
title: "Adjective Collector"
author: "Rj"
date: 2019-04-20
description: "List Test"
type: technical_note
draft: false
import requests
from bs4 import BeautifulSoup
page = requests.get('https://www.enchantedlearning.com/wordlist/adjectivesforpeople.shtml')
soup = BeautifulSoup(page.text, 'html.parser')
items = soup.select('div.wordlist-item')
item_list = ''
for item in items:
#print(item.get_text())
item_list …
Read More
Advanced-Custom-Lambda
title: "Advanced Custom Lambda"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
# Check the student passed either math or passed at least in 2 subjects. If no condidition matched, consider them as failed
def pass_math_or_two_subjects(row):
if(row.maths > 34):
return …
Read More
Append-To-Existing-Dictionary
title: "Append To Existing Dictionary"
author: "Raja CSP Raman"
date: 2019-05-02
description: "-"
type: technical_note
draft: false
import gensim
from gensim import corpora
from pprint import pprint
# How to create a dictionary from a list of sentences?
documents = [
"""More than half of survey participants also reported clicking on a headline expecting …
Read More
Apply Custom Function
title: "Apply Custom Function"
author: "Rj"
date: 2019-04-20
description: "List Test"
type: technical_note
draft: false
data = {
'city' : ['Toronto', 'Montreal', 'Waterloo'],
'points' : [80, 70, 90]
}
{'city': ['Toronto', 'Montreal', 'Waterloo'], 'points': [80, 70, 90]}
Read More
Apply-Custom-Lamdba-Function
import numpy as np
import pandas as pd
data = {
'city' : ['Toronto', 'Montreal', 'Waterloo'],
'points' : [80, 70, 90]
}
{'city': ['Toronto', 'Montreal', 'Waterloo'], 'points': [80, 70, 90]}
Read More
Apply-Function
data = {
'city' : ['Toronto', 'Montreal', 'Waterloo', 'Toronto', 'Waterloo', 'Toronto', 'Toronto'],
'points' : [80, 70, 90, 85, 79, 82, 200]
}
{'city': ['Toronto',
'Montreal',
'Waterloo',
'Toronto',
'Waterloo',
'Toronto',
'Toronto'],
'points': [80, 70, 90, 85, 79, 82, 200]}
Read More
Apply Function-2933
title: "Apply Function"
author: "Rj"
date: 2019-04-20
description: "List Test"
type: technical_note
draft: false
data = {
'city' : ['Toronto', 'Montreal', 'Waterloo', 'Toronto', 'Waterloo', 'Toronto', 'Toronto'],
'points' : [80, 70, 90, 85, 79, 82, 200]
}
{'city': ['Toronto',
'Montreal',
'Waterloo',
'Toronto',
'Waterloo',
'Toronto',
'Toronto'],
'points': [80, 70, 90, 85, 79 …
Read More
Argotranslate-1
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 argostranslate
print(pyu.ps2("argostranslate"))
import argostranslate.package
import argostranslate.translate
# Download and install the Finnish language package
from_code = "en …
Read More