This is a file that describes how our pipeline should be working for Marick Manrho. I hope it will be useful to him.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClassBuilder: | |
def __init__(self): | |
self.data = {} | |
def load_source1(self, params_for_source1): | |
self.data.update(api_call_source1(params_for_source1)) | |
def load_source1(self, params_for_source2): | |
self.data.update(api_call_source1(params_for_source2)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lark import Lark | |
grammar = r""" | |
start: _NL* _section+ | |
_section: _HEADER _content* _HEADER | |
_HEADER: "--- SECTION ---" _NL | |
_content: number_list | |
| assign | |
| _other | |
number_list: NUMBER+ _NL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/export/home/ccprakt3/miniconda3/lib/python3.9/site-packages/pandas/core/frame.py:3607: SettingWithCopyWarning: | |
A value is trying to be set on a copy of a slice from a DataFrame. | |
Try using .loc[row_indexer,col_indexer] = value instead | |
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy | |
self._set_item(key, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Data source | |
gen = ({'a': 3, 'b': 4} for i in range(300)) | |
a = map(lambda d: d['a'], gen) | |
b = map(lambda d: d['b'], gen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def outside_try(): | |
foo = None | |
try: | |
foo = load_foo() | |
except FooLoadingError: | |
return "Foo failed to load" | |
# Do all the things | |
return foo | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.optimize import curve_fit | |
from scipy import signal | |
def gauss(x, mu, sigma, A): | |
return A / (sigma * np.sqrt(2 * np.pi)) * np.exp(- .5 * np.power((x-mu)/sigma , 2)) | |
peakind = signal.find_peaks_cwt(inten_na2, np.arange(2,5), noise_perc=90, min_length=2, min_snr=2) | |
# plt.plot(lamb_na2, inten_na2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = ( (1, 2), (3, 6), (4, 8) ) | |
b = ( 1, 3, 4) | |
c = a / b | |
c == ( (1, 2), (1, 2), (1, 2) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
movement1 = Movement("test1", "daily") | |
movement2 = Movement("test2", "daily") | |
for i in range(6): | |
user = User(f"user{i}", f"user{i}@email.com", "pass") | |
user.save_to_db() | |
users = User.query.all() | |
MUA = MovementUserAssociation | |
muas = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Flask", | |
"type": "python", | |
"request": "launch", |
NewerOlder