repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/05_defense_evasion/WIN-190510202010.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: WDigest Downgrade Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/05/10 | | modification date | 2020/09/20 | | playbook related | [] | Hypothe...
liganega/Gongsu-DataSci
previous/y2017/Wextra/GongSu26_Pandas_Introduction_2.ipynb
gpl-3.0
from GongSu24_Pandas_Introduction_1 import * """ Explanation: Pandas 소개 2 GonsSu24 내용에 이어서 Pandas 라이브러리를 소개한다. 먼저 GongSu24를 임포트 한다. End of explanation """ s6 = Series(range(3), index=['a', 'b', 'c']) s6 """ Explanation: 색인(Index) 클래스 Pandas에 정의된 색인(Index) 클래스는 Series와 DataFrame 자료형의 행과 열을 구분하는 이름들의 목록을 저장하는 데에 사용된...
tensorflow/tfx
docs/tutorials/mlmd/mlmd_tutorial.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: NCC Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Concent...
google/starthinker
colabs/bigquery_run_query.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: BigQuery Query Run Run query on a project. License Copyright 2020 Google LLC, Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/sandbox-1/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-1', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: SANDBOX-1 Topic: Landice Sub-Topics: Gla...
tensorflow/docs
site/en/tutorials/interpretability/integrated_gradients.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
statsmodels/statsmodels.github.io
v0.12.2/examples/notebooks/generated/statespace_fixed_params.ipynb
bsd-3-clause
%matplotlib inline from importlib import reload import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from pandas_datareader.data import DataReader """ Explanation: Estimating or specifying parameters in state space models In this notebook we show how to fix specific val...
mauriciogtec/PropedeuticoDataScience2017
Alumnos/FedericoRiveroll/Tarea2_entregable.ipynb
mit
import numpy as np from numpy import * Eq = np.array([[1, 1, -1, 9],[0, 1, 3, 3],[-1, 0, -2, 2]]) A = Eq[:,0:3] # As b = Eq[:,3] # Resultados 9, 3, 2 # Las soluciones son: [0.666666666666667, 7.0, -1.3333333333333333] U,s,V = linalg.svd(A) # descomposición SVD de A # inversa usando pinv pinv = linalg.pinv(A) # inv...
QuantScientist/Deep-Learning-Boot-Camp
day03/1.2 Introduction - Tensorflow.ipynb
mit
# A simple calculation in Python x = 1 y = x + 10 print(y) import tensorflow as tf # The ~same simple calculation in Tensorflow x = tf.constant(1, name='x') y = tf.Variable(x+10, name='y') print(y) """ Explanation: <img src="imgs/tensorflow_head.png" /> Tensorflow TensorFlow (https://www.tensorflow.org/) is a softw...
kingb12/languagemodelRNN
old_comparisons/noing6_LSTM_v_BOW.ipynb
mit
report_files = ["/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing6_200_512_04drb/encdec_noing6_200_512_04drb.json", "/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing6_bow_200_512_04drb/encdec_noing6_bow_200_512_04drb.json"] log_files = ["/Users/bking/IdeaProjects/Lang...
ES-DOC/esdoc-jupyterhub
notebooks/snu/cmip6/models/sandbox-3/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'snu', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: SNU Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topics: Tracers. Properties: 6...
linsalrob/PhiSpy
jupyter_notebooks/metrics_vs_genomes.ipynb
mit
import os, sys import itertools import re import json %matplotlib inline from random import randint import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import gzip from math import log, e from scipy import stats from math import sqrt """ Explanation: Metrics vs Predictions In P...
statsmodels/statsmodels.github.io
v0.12.2/examples/notebooks/generated/statespace_dfm_coincident.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt np.set_printoptions(precision=4, suppress=True, linewidth=120) from pandas_datareader.data import DataReader # Get the datasets from FRED start = '1979-01-01' end = '2014-12-01' indprod = DataReade...
Kaggle/learntools
notebooks/deep_learning/raw/ex8_dropout_strides.ipynb
apache-2.0
import numpy as np from sklearn.model_selection import train_test_split from tensorflow import keras # Set up code checking from learntools.core import binder binder.bind(globals()) from learntools.deep_learning.exercise_8 import * print("Setup Complete") img_rows, img_cols = 28, 28 num_classes = 10 def prep_data(ra...
harmsm/pythonic-science
labs/03_molecular-structure/03_structure-files_key.ipynb
unlicense
%matplotlib inline from matplotlib import pyplot as plt import numpy as np import pandas as pd """ Explanation: Parsing and manipulating PDB files End of explanation """ def get_R(pdb_file): f = open(pdb_file,"r") lines = f.readlines() f.close() for l in lines: if l.startswith("REM...
M0nica/python-foundations-hw
07/.ipynb_checkpoints/billionaires-checkpoint.ipynb
mit
df['citizenship'].value_counts().head() us_pop = 318.9 #billion (2014) us_bill = df[df['citizenship'] == 'United States'] print("There are", us_pop/len(us_bill), "billionaires per billion people in the United States.") germ_pop = 0.08062 #(2013) germ_bill = df[df['citizenship'] == 'Germany'] print("There are", ger...
dougsweetser/ipq
q_notebooks/space-time_reversal.ipynb
apache-2.0
%%capture %matplotlib inline import numpy as np import sympy as sp import matplotlib.pyplot as plt # To get equations the look like, well, equations, use the following. from sympy.interactive import printing printing.init_printing(use_latex=True) from IPython.display import display # Tools for manipulating quaternion...
laowantong/algo_magic
doc/instructions.ipynb
mit
!pip install algo_magic """ Explanation: This set of IPython magic extensions is provided to the first year students enrolled in the algorithmics course at ISFATES (University of Lorraine). Installation In a Jupyter Notebook cell, simply paste this in a new cell and run it (shift-enter). End of explanation """ %load...
bjshaw/phys202-2015-work
assignments/assignment06/ProjectEuler17.ipynb
mit
def number_to_words(n): """Given a number n between 1-1000 inclusive return a list of words for the number.""" x = [] a = {1:'one',2:'two',3:'three',4:'four',5:'five',6:'six',7:'seven',8:'eight',9:'nine',10:'ten', 11:'eleven',12:'twelve',13:'thirteen',14:'fourteen',15:'fifteen',16:'sixteen',17:'sev...
changhoonhahn/centralMS
centralms/notebooks/notes_assemblybias.ipynb
mit
# random step (NO ASSEMBLY BIAS) t_NOabias = theta.copy() t_NOabias['sfh'] = {'name': 'random_step', 'dt_min': 0.5, 'dt_max': 0.5, 'sigma': 0.3} SHcat_NOabias = EvoWrap(t_NOabias) testEvo.EvolverQAplots(SHcat_NOabias, t_NOabias) plt.show() """ Explanation: If there's no assembly bias then it should be the same as ran...
zhuwei05/ml-basic
learn_pandas.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: 学习 pandas Reference 10 Minutes to pandas Cookbook 简介 Python Data Analysis Library pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python prog...
IS-ENES-Data/submission_forms
test/Templates/form_retrieval.ipynb
apache-2.0
from dkrz_forms import form_widgets form_widgets.show_status('form-retrieval') """ Explanation: Retrieve your DKRZ data form Via this form you can retrieve previously generated data forms and make them accessible via the Web again for completion. Additionally you can get information on the data ingest process status r...
johnhw/sqlexperiment
notebooks/design-record-plot.ipynb
mit
factors = [('F0', ['a', 'b']), ('F1', ['x', 'y'])] levels = [np.array(['a', 'b']), np.array(['x', 'y'])] e = ExperimentLog(":memory:", ntp_sync=False) if e.meta.stage == 'init': # needed? e.create('SESSION', 'data', description='') e.create('USER', 'user', description='user session') for factor in fa...
BayesianTestsML/tutorial
slides/case-against-nhst.ipynb
gpl-3.0
import numpy as np scores_a = np.array([ 95.95, 71.4 , 83.34, 49.99, 76.17, 86.22, 84.45, 81.87, 52.81, 75.04, 71.94, 50.12, 72.03, 60. , 83.69]) scores_b = np.array([ 97.88, 71.66, 82.87, 50.71, 74.17, 86.68, 85.46, 82.02, 60.08, 75.83, 74.53, 45.76, 72.65, 60. , 84.31]) sum(scores_a > sc...
UCSBarchlab/PyRTL
ipynb-examples/introduction-to-hardware.ipynb
bsd-3-clause
import pyrtl """ Explanation: Introduction to Hardware Design This code works through the hardware design process with the the audience of software developers more in mind. We start with the simple problem of designing a fibonacci sequence calculator (http://oeis.org/A000045). End of explanation """ def software_fi...
tpin3694/tpin3694.github.io
machine-learning/encode_days_of_the_week.ipynb
mit
# Load library import pandas as pd """ Explanation: Title: Encode Days Of The Week Slug: encode_days_of_the_week Summary: How to the days of the week for dates and times for machine learning in Python. Date: 2017-09-11 12:00 Category: Machine Learning Tags: Preprocessing Dates And Times Authors: Chris Albon Preli...
Kaggle/learntools
notebooks/pandas/raw/ex_4.ipynb
apache-2.0
import pandas as pd reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0) from learntools.core import binder; binder.bind(globals()) from learntools.pandas.data_types_and_missing_data import * print("Setup complete.") """ Explanation: Introduction Run the following cell to load your da...
Alexoner/mooc
cs231n/2016/assignment2/FullyConnectedNets.ipynb
apache-2.0
# As usual, a bit of setup import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solver import Solver %matplotlib inline ...
jordanopensource/data-science-bootcamp
session4/L3_Conclusion.ipynb
mit
#your code here """ Explanation: Conclusion I hope you enjoyed the lecture and could do crazy bayesian stuff in your next job as data scientist ! Check list Understand what machine learning is in terms of probabilites Can get started in constructing probabilistic graphical models using pgmpy Can get started in build...
BayesianTestsML/tutorial
Python/Hierarchical test.ipynb
gpl-3.0
import numpy as np scores = np.loadtxt('Data/diffNbcHnb.csv', delimiter=',') names = ("HNB", "NBC") print(scores) """ Explanation: Bayesian Hierarchical Test Module hierarchical in bayesiantests compares the performance of two classifiers that have been assessed by m-runs of k-fold cross-validation on q datasets. It r...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/cnrm-esm2-1-hr/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'cnrm-esm2-1-hr', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: CNRM-ESM2-1-HR Topic: Atmoschem Sub-Top...
awadalaa/DataSciencePractice
kaggle/titanic/TitanicPrediction2.ipynb
mit
import csv as csv import numpy as np import pandas as pd # We can use the pandas library in python to read in the csv file. # This creates a pandas dataframe and assigns it to the titanic variable. titanic = pd.read_csv("data/train.csv") # Print the first 5 rows of the dataframe. print(titanic.head(5)) print(titanic...
mne-tools/mne-tools.github.io
0.18/_downloads/1e53d1b1e265859ba0683a6745c36ed7/plot_stats_cluster_spatio_temporal.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import os.path as op import numpy as np from numpy.random import randn from scipy import stats as stats import mne from mne.epochs import equalize_epoch_counts from mne....
kraemerd17/kraemerd17.github.io
courses/python/material/ipynbs/Case Studies and Applications.ipynb
mit
from __future__ import division from pandas import Series, DataFrame import pandas as pd from numpy.random import randn import numpy as np pd.options.display.max_rows = 12 np.set_printoptions(precision=4, suppress=True) import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Financial and Economic Data Ap...
SchwaZhao/networkproject1
02_Analysis_of_Twitter_Social_Network.ipynb
mit
#load tweets import json filename = 'AI2.txt' tweet_list = [] with open(filename, 'r') as fopen: # each line correspond to a tweet for line in fopen: if line != '\n': tweet_list.append(json.loads(line)) """ Explanation: Analysis of a Twitter Social Network In this section we a...
jhillairet/scikit-rf
doc/source/examples/networktheory/IEEEP370 Deembedding.ipynb
bsd-3-clause
import skrf as rf import matplotlib.pyplot as plt from skrf.calibration import IEEEP370_SE_NZC_2xThru from skrf.calibration import IEEEP370_MM_NZC_2xThru from skrf.calibration import IEEEP370_SE_ZC_2xThru from skrf.calibration import IEEEP370_MM_ZC_2xThru from skrf.media import MLine import numpy as np rf.stylely() ""...
4dsolutions/Python5
Emod Angles.ipynb
mit
import numpy as np import pandas as pd from math import atan, tan, degrees, radians, sqrt """ Explanation: Central Angles of the E-Module By David Koski (trig) & Kirby Urner (python) The above Fig. 986.411B shows the "plane net" or template for an E or T module. If you cut it out with scissors and fold it up, rever...
google-research/google-research
aav/model_and_dataset_analysis/200609_figure3_and_tables_shared.ipynb
apache-2.0
import os import zipfile from IPython.display import display from matplotlib import pyplot import numpy import pandas import scipy.spatial.distance as distance import scipy.stats import seaborn # The canonical single-letter code residue alphabet. RESIDUES = tuple('ACDEFGHIKLMNPQRSTVWY') # Residues sorted by physico...
jmlon/PythonTutorials
pandas/Apache log analyzer with Pandas.ipynb
gpl-3.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt from dateutil.parser import * """ Explanation: Building an Apache log analyzer with Pandas Apache access logs are text files that record the activity of a web site. The analysis of log files provides useful insights for web masters and site owners....
YeEmrick/learning
cs231/assignment/assignment2/ConvolutionalNetworks.ipynb
apache-2.0
# As usual, a bit of setup from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.cnn import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient from cs231n.layers import * fro...
sthuggins/phys202-2015-work
assignments/assignment05/InteractEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 2 Imports End of explanation """ def plot_sine1(a, b): x=range(0, 4*np.pi) y= np.sin(a*x + b) plt.pl...
danijel3/PyHTK
python-notebooks/ResamplingTest.ipynb
apache-2.0
import sys sys.path.append('../python') from HTKFeat import MFCC_HTK import numpy as np %matplotlib inline import matplotlib.pyplot as P """ Explanation: Resampling from 16kHz to 8kHz This notebook demonstrates resampling from 16kHz to 8kHz using the scipy.signal.resample method. This isn't theonly or the best metho...
KristianHolsheimer/tensorflow_training
text_data_representation.ipynb
gpl-3.0
import tensorflow as tf import numpy as np import pandas as pd %matplotlib inline """ Explanation: Sparse and dense representations for text data Before we can start training we need to prepare our input data in a way that our model will understand it. End of explanation """ from utils import SentenceEncoder sents ...
kinshuk4/MoocX
misc/deep_learning_notes/Ch4_Recurrent_Networks/000_Multi-layer_Perceptron_intro_to_edf_framework/Simple_Multi-layer_Perceptron_MNIST_Example.ipynb
mit
sigmoid = lambda x: 1/(1 + np.exp(-x)) xs = np.linspace(-5, 5, 100) plt.plot(xs, sigmoid(xs), linewidth=4, alpha=0.4) plt.ylim(-.5, 1.5); """ Explanation: Plain sigmoid activation function sigmoid function $$\sigma(x) = \frac{1}{1 + e^{-x}}$$ looks like: End of explanation """ ########### we use sigmoid to demonstra...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/sandbox-3/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-3', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: SANDBOX-3 Sub-Topics: Radiative Forcin...
flohorovicic/pynoddy
docs/notebooks/Pynoddy_parallel_MC.ipynb
gpl-2.0
%matplotlib inline # here the usual imports. If any of the imports fails, # make sure that pynoddy is installed # properly, ideally with 'python setup.py develop' # or 'python setup.py install' import sys, os import matplotlib.pyplot as plt import numpy as np # adjust some settings for matplotlib from matplotlib imp...
tpin3694/tpin3694.github.io
machine-learning/.ipynb_checkpoints/imbalanced_classes_in_svm-checkpoint.ipynb
mit
# Load libraries from sklearn.svm import SVC from sklearn import datasets from sklearn.preprocessing import StandardScaler import numpy as np """ Explanation: Title: Imbalanced Classes In SVM Slug: imbalanced_classes_in_svm Summary: How to handle imbalanced classes in support vector machines in Scikit-Learn Date: ...
pdamodaran/yellowbrick
examples/bbengfort/cluster.ipynb
apache-2.0
import sys sys.path.append("../..") import numpy as np import yellowbrick as yb import matplotlib.pyplot as plt from functools import partial from sklearn.datasets import make_blobs as sk_make_blobs from sklearn.datasets import make_circles, make_moons # Helpers for easy dataset creation N_SAMPLES = 1000 N_FEAT...
JingJunYin/tensorflow
tensorflow/tools/docker/notebooks/3_mnist_from_scratch.ipynb
apache-2.0
from __future__ import print_function from IPython.display import Image import base64 Image(data=base64.decodestring("iVBORw0KGgoAAAANSUhEUgAAAMYAAABFCAYAAAARv5krAAAYl0lEQVR4Ae3dV4wc1bYG4D3YYJucc8455yCSSIYrBAi4EjriAZHECyAk3rAID1gCIXGRgIvASIQr8UTmgDA5imByPpicTcYGY+yrbx+tOUWpu2e6u7qnZ7qXVFPVVbv2Xutfce+q7hlasmTJktSAXrnn8...
mohanprasath/Course-Work
numpy/numpy_exercises_from_kyubyong/String_operations.ipynb
gpl-3.0
from __future__ import print_function import numpy as np author = "kyubyong. https://github.com/Kyubyong/numpy_exercises" np.__version__ """ Explanation: String operations End of explanation """ x1 = np.array(['Hello', 'Say'], dtype=np.str) x2 = np.array([' world', ' something'], dtype=np.str) """ Explanation: Q...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_object_evoked.ipynb
bsd-3-clause
import os.path as op import mne """ Explanation: The :class:Evoked &lt;mne.Evoked&gt; data structure: evoked/averaged data The :class:Evoked &lt;mne.Evoked&gt; data structure is mainly used for storing averaged data over trials. In MNE the evoked objects are usually created by averaging epochs data with :func:mne.Epo...
BrentDorsey/pipeline
gpu.ml/notebooks/01b_Explore_Numba.ipynb
apache-2.0
import math def hypot(x, y): x = abs(x); y = abs(y); t = min(x, y); x = max(x, y); t = t / x; return x * math.sqrt(1+t*t) %%timeit hypot(3.0, 4.0) """ Explanation: Explore Numba - aka. Numpy for GPU Create and Run a Custom Python Function Note the slow execution time. End of explanation """ ...
planetlabs/notebooks
jupyter-notebooks/cloud-native-geospatial/intro-to-cogs/introduction-to-cogs-part2.ipynb
apache-2.0
import requests import os from requests.auth import HTTPBasicAuth import json import pathlib from rio_cogeo.cogeo import cog_translate from rio_cogeo.profiles import cog_profiles """ Explanation: For the purpose of this demonstration, we will place a simple order to the Orders API that will return us some Non Cloud Op...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_sensors_time_frequency.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet, psd_multitaper from mne.datasets import somato """ Explanation: Frequency and time-frequency sensors analysis The objective is to show you how to explore the spectral content of your data (frequency and time-frequ...
Leguark/pygeomod
notebooks_GeoPyMC/PyMC for Geology Tutorial/PyMC geomod_1.ipynb
mit
%matplotlib inline from IPython.core.display import Image import numpy as np import matplotlib.pyplot as plt import sys, os import shutil #import geobayes_simple as gs import pymc as pm # PyMC 2 from pymc.Matplot import plot from pymc import graph as gr import numpy as np #import daft from IPython.core.pylabtools imp...
afunTW/dsc-crawling
02_selenium/00_selenium_crawling_render_image.ipynb
apache-2.0
import os import requests import re from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.common.by import By from fake_useragent import UserAgent from pprint import pprint url = 'https://afuntw.github.io/Test-Crawling-Website/pages/gallery/index.html' fu = UserAgent() """ Explanation:...
nreimers/deeplearning4nlp-tutorial
2015-10_Lecture/Lecture4/code/BrownCorpus/GenreClassification.ipynb
apache-2.0
import nltk import gensim import nltk.corpus import random from nltk.corpus import brown from nltk.stem.porter import * import numpy as np np.random.seed(0) num_max_words = 5000 stopwords = {} for stopword in nltk.corpus.stopwords.words('english'): stopwords[stopword.lower()] = True def preprocessDocumen...
jphall663/GWU_data_mining
05_neural_networks/src/py_part_5_MNIST_autoencoder.ipynb
apache-2.0
# imports and inits import h2o from h2o.estimators.deeplearning import H2ODeepLearningEstimator h2o.init() import matplotlib.pyplot as plt %matplotlib inline import numpy as np import pandas as pd """ Explanation: License Copyright (C) 2017 J. Patrick Hall, jphall@gwu.edu Permission is hereby granted, free of charg...
ildoonet/tf-openpose
tf_pose/slim/nets/mobilenet/mobilenet_example.ipynb
apache-2.0
!git clone https://github.com/tensorflow/models from __future__ import print_function from IPython import display checkpoint_name = 'mobilenet_v2_1.0_224' #@param url = 'https://storage.googleapis.com/mobilenet_v2/checkpoints/' + checkpoint_name + '.tgz' print('Downloading from ', url) !wget {url} print('Unpacking') ...
sueiras/training
tensorflow/02-text/03-word_tagging/01_identify_tags_in_airline_database_LSTM - EXERCISE.ipynb
gpl-3.0
from __future__ import print_function import sys import os import numpy as np import tensorflow as tf print(tf.__version__) os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="0" #Show images import matplotlib.pyplot as plt %matplotlib inline # plt configuration plt.rcParams['figure.f...
darioizzo/pykep
doc/sphinx/examples/solar_orbiter.ipynb
gpl-3.0
# Pykep imports from pykep.trajopt import mga_1dsm, launchers from pykep.planet import jpl_lp from pykep import epoch from pykep.core import lambert_problem, propagate_lagrangian, fb_prop from pykep import DAY2SEC, DAY2YEAR, AU, RAD2DEG, ic2par from pykep.trajopt.gym import solar_orbiter_resdsm, solar_orbiter_1dsm from...
jenshnielsen/HJCFIT
exploration/Example_MLL_Fit_AChR_1patch.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import sys, time, math import numpy as np from dcprogs.likelihood import inv """ Explanation: HJCFIT- maximum likelihood fit of single-channel data: a simple example Some general settings: End of explanation """ from dcpyps.samples import samples from dcpyps import...
MTG/essentia
src/examples/python/tutorial_tensorflow_real-time_auto-tagging.ipynb
agpl-3.0
!pip -q install pysoundcard """ Explanation: Real-time music auto-tagging In this tutorial, we use Essentia's TensorFlow integration to perform auto-tagging in real-time. Additionally, this serves as an example of TensorFlow inference in streaming mode and can be easily adapted to work offline. Setup To install Essent...
xunzhang/dynet
examples/jupyter-tutorials/RNNs.ipynb
apache-2.0
# we assume that we have the dynet module in your path. # OUTDATED: we also assume that LD_LIBRARY_PATH includes a pointer to where libcnn_shared.so is. import dynet as dy """ Explanation: RNNs tutorial End of explanation """ pc = dy.ParameterCollection() NUM_LAYERS=2 INPUT_DIM=50 HIDDEN_DIM=10 builder = dy.LSTMBuil...
garibaldu/multicauseRBM
Max/MNIST-ORBM-Inference.ipynb
mit
for key in results: logging.info("Plotting, win, lose and tie images for the {}".format(key)) results[key].plot_various_images() """ Explanation: In the cell below I have calculated in the previous cell the loglikelyhood score of the partitioned sampling and vanilla sampling technique image-wise. So I have a s...
UW-Hydro/bmorph
tutorial/bmorph_tutorial.ipynb
mit
%pylab inline %load_ext autoreload %autoreload 2 %reload_ext autoreload import warnings warnings.filterwarnings('ignore') import os import sys import numpy as np import xarray as xr import pandas as pd import geopandas as gpd import matplotlib as mpl import matplotlib.pyplot as plt from tqdm.notebook import tqdm from ...
Olsthoorn/TransientGroundwaterFlow
exercises_notebooks/exercChap6_3+answ.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt from scipy.special import expi def W(u): return -expi(-u) # Theis well function """ Explanation: Exercises chapter 6.3 (Theis) End of explanation """ # sampling times in minutes t_min = np.array([1, 2, 3, 5, 7, 10, 15, 30, 45, 60, 120, 180, 240, 300, 360, ...
keras-team/keras-io
guides/ipynb/working_with_rnns.ipynb
apache-2.0
import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers """ Explanation: Working with RNNs Authors: Scott Zhu, Francois Chollet<br> Date created: 2019/07/08<br> Last modified: 2020/04/14<br> Description: Complete guide to using & customizing RNN layers. Introduction ...
Featuretools/featuretools
docs/source/getting_started/handling_time.ipynb
bsd-3-clause
import pandas as pd pd.options.display.max_columns = 200 import featuretools as ft es = ft.demo.load_mock_customer(return_entityset=True, random_seed=0) es['transactions'].head() """ Explanation: Handling Time When performing feature engineering with temporal data, carefully selecting the data that is used for any c...
djfan/why_yellow_taxi
Filter/Sjoin_Pyspark_5_ServiceTime.ipynb
mit
sc """ Explanation: df_shuffle.csv | Day of Week | Index | | ----------- | ----- | | Monday | 0 | | Tuesday | 1 | | Wednesday | 2 | | Thursday | 3 | | Friday | 4 | | Saturday | 5 | | Sunday | 6 | | Hour | Index | | ------------------- | ----- | | 00...
tensorflow/docs-l10n
site/ko/tutorials/images/segmentation.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/cmip6/models/sandbox-3/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-3', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: NASA-GISS Source ID: SANDBOX-3 Sub-Topics: Radiative Forcings. Propertie...
samuelshaner/openmc
docs/source/pythonapi/examples/post-processing.ipynb
mit
%matplotlib inline from IPython.display import Image import numpy as np import matplotlib.pyplot as plt import openmc """ Explanation: This notebook demonstrates some basic post-processing tasks that can be performed with the Python API, such as plotting a 2D mesh tally and plotting neutron source sites from an eigen...
rahulkgup/deep-learning-foundation
intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
ozak/CompEcon
notebooks/Faster Computation with Numba.ipynb
gpl-3.0
from numba import jit, njit, autojit, jitclass import numba as nb import math import warnings with warnings.catch_warnings(): warnings.simplefilter('ignore', nb.errors.NumbaDeprecationWarning) """ Explanation: Faster Computations with Numba Some notes mostly for myself, but could be useful to you Altough Python i...
mbuchove/notebook-wurk-b
stats/astro283_hw5.ipynb
mit
# import modules import numpy as np from matplotlib import pyplot %matplotlib inline from scipy import optimize, stats, special """ Explanation: <h2>HW #5</h2> Matt Buchovecky Astro 283 End of explanation """ # define the pdf for the Rice distribution as a subclass of rv_continuous class Rice_dist(stats.rv_contin...
lfairchild/PmagPy
data_files/notebooks/data_model_conversion.ipynb
bsd-3-clause
from importlib import reload import pmagpy.contribution_builder as cb from pmagpy import ipmag import os import json import numpy as np import sys import pandas as pd import numpy as np from pandas import DataFrame from pmagpy import builder2 as builder from pmagpy import validate_upload2 as validate_upload from pmagp...
Vvkmnn/books
AutomateTheBoringStuffWithPython/lesson21.ipynb
gpl-3.0
'hello ' + 'world!' """ Explanation: Lesson 21: String Formatting You can typically combine strings with +. End of explanation """ name = 'Alice' place = 'Main Street' time = '6 pm' food = 'turnips' print('Hello ' + name + ', you are invited to a party at ' + place + ' at ' + time + '. Please bring ' + food + '.') ...
google/timesketch
notebooks/MUS2019_CTF.ipynb
apache-2.0
# Install the TimeSketch API client if you don't have it !pip install timesketch-api-client # Import some things we'll need from timesketch_api_client import config from timesketch_api_client import search import pandas as pd pd.options.display.max_colwidth = 60 """ Explanation: <a href="https://colab.research.google...
google/sentencepiece
python/add_new_vocab.ipynb
apache-2.0
import sentencepiece_model_pb2 as model m = model.ModelProto() m.ParseFromString(open("old.model", "rb").read()) """ Explanation: You can add new special tokens to pre-trained sentencepiece model Run this code in google/sentencepiece/python/ Load pre-trained sentencepiece model Pre-trained model is needed End of expla...
sarvex/tensorflow
tensorflow/lite/g3doc/examples/super_resolution/overview.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
leriomaggio/python-in-a-notebook
06 Dictionaries.ipynb
mit
dictionary_name = {key_1: value_1, key_2: value_2, key_3: value_3} """ Explanation: Dictionaries (Data Structure) Dictionaries allow us to store connected bits of information. For example, you might store a person's name and age together. <a name="top"></a>Contents What are dictionaries? General Syntax Example Exerci...
cosmolejo/Fisica-Experimental-3
Fourier/Tarea_Fourier/Ciclo.Solar.ipynb
gpl-3.0
import numpy as np import matplotlib import pylab as plt import scipy.misc as pim from scipy import stats % matplotlib inline font = {'weight' : 'bold', 'size' : 12} matplotlib.rc('font', **font) """ Explanation: Tarea 04: Análisis de Fourier - ciclos solares Alejando Mesa y Yennifer Angarita Ciclos del So...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/introduction_to_tensorflow/labs/bigquery_tensorflow.ipynb
apache-2.0
%%bash # create output dataset bq mk advdata %%bigquery CREATE OR REPLACE MODEL advdata.ulb_fraud_detection TRANSFORM( * EXCEPT(Amount), SAFE.LOG(Amount) AS log_amount ) OPTIONS( INPUT_LABEL_COLS=['class'], AUTO_CLASS_WEIGHTS = TRUE, DATA_SPLIT_METHOD='seq', DATA_SPLIT_COL='Time', MODEL_TY...
machlearn/ipython-notebooks
ML Algorithm - Random Forests.ipynb
mit
from sklearn.ensemble import BaggingClassifier from sklearn.neighbors import KNeighborsClassifier bagging = BaggingClassifier(KNeighborsClassifier(), max_samples = 0.5, max_features=0.5) """ Explanation: Random Forests belong to the class of ensemble methods. The goal of ensemble methods is to combine the predictions ...
anshbansal/anshbansal.github.io
udacity_data_science_notes/intro_machine_learning/lesson_01/lesson_01.ipynb
mit
import numpy as np X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) Y = np.array([1, 1, 1, 2, 2, 2]) from sklearn.naive_bayes import GaussianNB clf = GaussianNB() clf.fit(X, Y) print(clf.predict([[-0.8, -1], [4, 1]])) """ Explanation: Lesson 01 - Naive Bayes ML in The Google Self-Driving Car We wi...
anhaidgroup/py_entitymatching
notebooks/guides/step_wise_em_guides/Evaluating the Selected Matcher.ipynb
bsd-3-clause
# Import py_entitymatching package import py_entitymatching as em import os import pandas as pd # Set the seed value seed = 0 # Get the datasets directory datasets_dir = em.get_install_path() + os.sep + 'datasets' path_A = datasets_dir + os.sep + 'dblp_demo.csv' path_B = datasets_dir + os.sep + 'acm_demo.csv' path_...
authman/DAT210x
Module5/Module5 - Lab7.ipynb
mit
import random, math import pandas as pd import numpy as np import scipy.io from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt matplotlib.style.use('ggplot') # Look Pretty # Leave this alone until indicated: Test_PCA = False """ Explanation: DAT210x - Programming with Python for DS Module5- Lab...
sz2472/foundations-homework
data and database/Classnote_06_30.ipynb
mit
from flask import Flask, request, render_template app=Flask(_name_) @app.route("/") def display_form(): return render_template("simplify_home.html") @app.route("/transformed", methods=["POST"]) #methods=["POST"]:to make a post request def display_transformation(): return"put transformed text here" app.run() @...
matias-rivera/seminario2
Comparacion de Documentos.ipynb
mit
import graphlab """ Explanation: Importar GraphLab End of explanation """ people = graphlab.SFrame('people_wiki.gl/') """ Explanation: Cargar el dataset End of explanation """ people.head() len(people) """ Explanation: Los datos contienen articulos de wikipedia sobre diferentes personas. End of explanation """ ...
xR86/ml-stuff
labs-machine-learning/Intro_Entropy.ipynb
mit
import math import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') #print(plt.style.available) """ Explanation: Some introduction to entropy Entropy (or expected surprisal) is a measure of either information given by probability or of the chaos present in a system (more or less: how much of my dat...
TomTranter/OpenPNM
examples/simulations/Advection-Diffusion.ipynb
mit
import numpy as np import openpnm as op np.random.seed(10) %matplotlib inline ws = op.Workspace() ws.settings["loglevel"] = 40 np.set_printoptions(precision=5) net = op.network.Cubic(shape=[1, 20, 30], spacing=1e-4) """ Explanation: Advection-Diffusion In this example, we will learn how to perform an advection-diffusi...
opesci/devito
examples/finance/bs_ivbp.ipynb
mit
from devito import (Eq, Grid, TimeFunction, Operator, solve, Constant, SpaceDimension, configuration, SubDomain) from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.axis3d import Axis import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib import cm from sympy.stats...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/02_generalization/labs/create_datasets.ipynb
apache-2.0
!pip install --user google-cloud-bigquery==1.25.0 """ Explanation: <h1> Explore and create ML datasets </h1> In this notebook, we will explore data corresponding to taxi rides in New York City to build a Machine Learning model in support of a fare-estimation tool. The idea is to suggest a likely fare to taxi riders s...
mne-tools/mne-tools.github.io
0.17/_downloads/c1aa88a2be3f4bc4a4552ce39a81e4e1/plot_morph_volume_stc.ipynb
bsd-3-clause
# Author: Tommy Clausner <tommy.clausner@gmail.com> # # License: BSD (3-clause) import os import matplotlib.pyplot as plt import nibabel as nib import mne from mne.datasets import sample from mne.minimum_norm import apply_inverse, read_inverse_operator from nilearn.plotting import plot_glass_brain print(__doc__) ""...
IST256/learn-python
content/lessons/04-Iterations/LAB-Iterations.ipynb
mit
i = 1 while i <= 3: print(i,"Mississippi...") i=i+1 print("Blitz!") """ Explanation: Class Coding Lab: Iterations The goals of this lab are to help you to understand: How loops work. The difference between definite and indefinite loops, and when to use each. How to build an indefinite loop with complex exit c...
bioinformatica-corso/lezioni
laboratorio/lezione11-04nov21/lezione6-pandas.ipynb
cc0-1.0
import pandas as pd """ Explanation: Introduzione a Pandas Pandas è una libreria, costruita sulla base della libreria numpy, che ha lo scopo di manipolare data frames. Oggetto di tipo DataFrame = tabella organizzata in righe (records) e colonne intestate. Pandas offre tre funzionalità principali: costruzione interrog...
probml/pyprobml
notebooks/misc/Superimport.ipynb
mit
!pip install superimport -qqq !pip install deimport -qqq import superimport def try_deimport(): try: from deimport.deimport import deimport deimport(superimport, verbose=False) except Exception as e: print(e) """ Explanation: <a href="https://colab.research.google.com/github/probml/...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session08/Day2/CorrallingUnrulyDataSolutions.ipynb
mit
# Solution 1 - pure python solution with pandas with open('irsa_catalog_WISE_iPTF14jg_search_results.tbl') as f: ll = f.readlines() for linenum, l in enumerate(ll): if l[0] == '|': header = l.replace('|', ',').replace(' ', '') header = list(header[1:-2].split(',')) b...