Skip to content

Instantly share code, notes, and snippets.

View masasa27's full-sized avatar

masasa masasa27

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Poly:
def __init__(self, *args):
self._coeffs = args
def __repr__(self):
return f"Poly(*{self._coeffs})"
def __add__(self, other):
return Poly(*(x + y for x,y in zip(self._coeffs, other._coeffs)))
@masasa27
masasa27 / basic_poly.py
Created July 11, 2020 11:15
basic poly
class Poly:
def __init__(self, *args):
self._coeffs = args
p1 = Poly(4,2,5)
p2 = Poly(1,2,3)
@masasa27
masasa27 / args_kwargs.ipynb
Last active August 2, 2020 16:49
args.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@masasa27
masasa27 / unpack_iterable.ipynb
Last active July 10, 2020 15:54
unpacking.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@masasa27
masasa27 / dicts.ipynb
Created May 23, 2020 16:09
gists2.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@masasa27
masasa27 / dicts.ipynb
Last active May 23, 2020 16:08
dicts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@masasa27
masasa27 / ln.py
Created May 18, 2020 21:37
ln.py
import sklearn
import pandas as pd
import numpy as np
from sklearn.datasets import load_boston
from sklearn.linear_model import LinearRegression
# loading data set
boston = load_boston()
# data
@masasa27
masasa27 / second_queue_example.py
Created May 9, 2020 10:48
second_queue_example.py
from queue import Queue, PriorityQueue
from threading import Thread
import random
import time
class RawData:
def __init__(self):
self.data_queue = PriorityQueue(maxsize=10)