Skip to content

Instantly share code, notes, and snippets.

View PandaWhoCodes's full-sized avatar

Thomas Ashish Cherian PandaWhoCodes

View GitHub Profile
A
A + Certified
A-110
A-122
A-123
A-133
A-frames
A-GPS
A/B Testing
A/R analysis
@PandaWhoCodes
PandaWhoCodes / ner.py
Created January 27, 2020 18:43
NER - Named Entity Extraction
import string
from nltk.stem.snowball import SnowballStemmer
import os
from nltk.chunk import conlltags2tree, tree2conlltags
import pickle
# Change here
corpus_root = 'gmb-2.2.0'
@PandaWhoCodes
PandaWhoCodes / get_all_links.py
Last active June 5, 2023 15:36
Code to retrieve all links from a given URL
To sell only the stocks that are not there in this week's new strategy and keep the stocks that still remain, you can modify the code as follows:
```python
import backtrader as bt
import pandas as pd
# Define the strategy
class MyStrategy(bt.Strategy):
def __init__(self):
@PandaWhoCodes
PandaWhoCodes / todo.py
Created June 25, 2019 06:34
Simplest TODO list GUI with Python and PySimpleGUI - perfect for teaching python GUI
import PySimpleGUI as sg
tasks = ["something", "something2", "something3"]
layout = [
[sg.Text('ToDo')],
[sg.InputText('Enter ToDo Item', key='todo_item'), sg.Button(button_text='Add', key="add_save")],
[sg.Listbox(values=tasks, size=(40, 10), key="items"), sg.Button('Delete'), sg.Button('Edit')],
]
import logging
import collections
import threading
import time
from collections import defaultdict
def log_info(message, logger):
logger.info(message)
time.sleep(3)
import logging
import time
import threading
from collections import defaultdict
def log_info(message,logger):
logger.info(message)
time.sleep(3)
logger.info(message)
import logging
import time
import threading
import io
def log_info(message,logger):
logger.info(message)
time.sleep(3)
logger.info(message)
import logging
import time
import threading
logger = logging.getLogger()
# Set up logging
logging.basicConfig(
level=logging.INFO, format="%(asctime)s %(message)s", datefmt="%Y-%m-%d %H:%M:%S"
)
@PandaWhoCodes
PandaWhoCodes / noise.py
Created October 29, 2017 11:29
Noise reduction using pyaudio documentation code
"""
Measure the frequencies coming in through the microphone
Patchwork of wire_full.py from pyaudio tests and spectrum.py from Chaco examples
"""
import pyaudio
import numpy as np
import scipy.signal
CHUNK = 1024 * 2