repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
ray-project/ray
doc/source/tune/examples/nevergrad_example.ipynb
apache-2.0
# !pip install ray[tune] !pip install nevergrad==0.4.3.post7 """ Explanation: Running Tune experiments with Nevergrad In this tutorial we introduce Nevergrad, while running a simple Ray Tune experiment. Tune’s Search Algorithms integrate with Nevergrad and, as a result, allow you to seamlessly scale up a Nevergrad op...
diegocavalca/Studies
deep-learnining-specialization/2. improving deep neural networks/week2/Optimization methods.ipynb
cc0-1.0
import numpy as np import matplotlib.pyplot as plt import scipy.io import math import sklearn import sklearn.datasets from opt_utils import load_params_and_grads, initialize_parameters, forward_propagation, backward_propagation from opt_utils import compute_cost, predict, predict_dec, plot_decision_boundary, load_data...
AllenDowney/ModSimPy
soln/yoyo_soln.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * """ Explanation: Modeling and Simulati...
SHDShim/pytheos
examples/5_calculate_nonstatic_terms_Dorogokupets2007.ipynb
apache-2.0
%config InlineBackend.figure_format = 'retina' """ Explanation: For high dpi displays. End of explanation """ import uncertainties as uct import numpy as np import matplotlib.pyplot as plt from uncertainties import unumpy as unp import pytheos as eos v0 = 3.9231**3 v = np.linspace(v0, v0 * 0.8, 20) """ Explanation...
jeffakolb/Data-Science-45min-Intros
long-tail-distributions-001/long-tails-001.ipynb
unlicense
# Plotting library import matplotlib.pyplot as plt %matplotlib inline # mathematics from math import exp, pi, sqrt, log from numpy import linspace, hstack from collections import Counter from random import sample from random import uniform from functools import reduce # special powerlaw fitting library import powerla...
dtamayo/MachineLearning
Day2/TitanicPandas.ipynb
gpl-3.0
import pandas as pd df = pd.read_csv('data/train.csv') df.head() df.tail() df.shape """ Explanation: Intro to Data Manipulation and Pandas Dan Tamayo Material draws from a blog working through the Titanic dataset by Dave Novelli, as well as the Pandas Cookbook by Julia Evans Follow Along In a terminal, navigate to ...
phobson/statsmodels
examples/notebooks/quantile_regression.ipynb
bsd-3-clause
%matplotlib inline from __future__ import print_function import patsy import numpy as np import pandas as pd import statsmodels.api as sm import statsmodels.formula.api as smf import matplotlib.pyplot as plt from statsmodels.regression.quantile_regression import QuantReg data = sm.datasets.engel.load_pandas().data da...
FinTechies/HedgingRL
notebooks/Environment.ipynb
mit
import json from os import path import pandas as pd import gym.envs import numpy as np num_steps = 100 gym.envs.register(id='obs-v2', entry_point='gym_bs.envs:EuropeanOptionEnv', kwargs={'t': num_steps, 'n': 1, 's0': 49, ...
DistrictDataLabs/yellowbrick
examples/iguk1987/Yellowbrick_Tour.ipynb
apache-2.0
import numpy as np import pandas as pd %matplotlib inline from cycler import cycler import matplotlib.style import matplotlib as mpl mpl.style.use('seaborn-white') import matplotlib.pyplot as plt from matplotlib.pyplot import figure from sklearn.cluster import KMeans from sklearn.linear_model import RidgeCV from sklear...
statkclee/ThinkStats2
code/chap09soln-kor.ipynb
gpl-3.0
from __future__ import print_function, division import first import hypothesis import scatter import thinkstats2 import numpy as np """ Explanation: 통계적 사고 (2판) 연습문제 (thinkstats2.com, think-stat.xwmooc.org)<br> Allen Downey / 이광춘(xwMOOC) End of explanation """ def RunTests(live, iters=1000): """Runs the tests ...
sbailey/knltest
doc/portland-extract.ipynb
bsd-3-clause
import numpy as np %pylab inline #- Raw data from runs on Cori Haswell and Cori KNL with #- two different python distributions (IDP and ContinuumIO Anaconda+MKL) nspec = np.array([5,10,15,20,25]) rate_hsw_idp = np.array([464.1, 623.0, 595.2, 303.6, 241.1]) rate_hsw_ana = np.array([466.3, 631.4, 599.6, 308.9, 244.1]) r...
chris1610/pbpython
notebooks/Forecasting-with-prophet.ipynb
bsd-3-clause
import pandas as pd import numpy as np from fbprophet import Prophet import matplotlib.pyplot as plt """ Explanation: Notebook from Forecast Website Traffic Using Facebook's Prophet Library Note: The recommended way to install prophet is to use the following command: conda install -c conda-forge fbprophet End of expl...
johnnyliu27/openmc
examples/jupyter/triso.ipynb
mit
%matplotlib inline from math import pi import numpy as np import matplotlib.pyplot as plt import openmc import openmc.model """ Explanation: OpenMC includes a few convenience functions for generationing TRISO particle locations and placing them in a lattice. To be clear, this capability is not a stochastic geometry ca...
lmoresi/UoM-VIEPS-Intro-to-Python
Notebooks/Numpy+Scipy/8 - Numpy, Scipy Miscellany.ipynb
mit
import numpy as np from scipy.io import netcdf """ Explanation: Data storage Python provides file read write and object serialisation / reconstruction (python pickle module). numpy provides methods for storing and retrieving structured arrays quickly and efficiently (including data compression). scipy provides some he...
InsightSoftwareConsortium/SimpleITK-Notebooks
Python/68_Registration_Errors.ipynb
apache-2.0
import SimpleITK as sitk import numpy as np import copy %matplotlib notebook from gui import PairedPointDataManipulation, display_errors import matplotlib.pyplot as plt from registration_utilities import registration_errors """ Explanation: Registration Errors, Terminology and Interpretation <a href="https://mybinder...
EvanBianco/Practical_Programming_for_Geoscientists
Build_and_test_environment.ipynb
apache-2.0
!python -V # Should be 3.5 import numpy as np import matplotlib.pyplot as plt from scipy.signal import ricker """ Explanation: Build and test the environment This document explains how to set up your environment for the geocomputing course. 1. Install Anaconda First, install Anaconda for Python 3.5, following the in...
Cyb3rWard0g/ThreatHunter-Playbook
docs/notebooks/windows/05_defense_evasion/WIN-190407183310.ipynb
gpl-3.0
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Enable Remote Desktop Conections Registry Metadata | | | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/04/07 | | modification date | 2020/09/20 | | playbook rela...
fdion/stemgraphic
notebooks/semi_graphic_displays_and_charsets.ipynb
mit
import pandas as pd from stemgraphic.num import text_heatmap, heatmatrix, text_hist, text_dot, stem_tally, stem_text from stemgraphic.helpers import available_charsets """ Explanation: Semi graphic displays and charsets Some text or semi graphic displays included in stemgraphic. imports End of explanation """ df = p...
yala/introdeeplearning
draft/part1.ipynb
mit
trainSet = p.load( open('data/train.p','rb')) devSet = p.load( open('data/dev.p','rb')) testSet = p.load( open('data/test.p','rb')) ## Let's look at the size of what we have here. Note, we could use a much larger train set, ## but we keep it mid-size so you can run this whole thing off your laptop len(trainSet), len(...
HaoMood/cs231n
assignment1/assignment1sol/2nnet/main.ipynb
gpl-3.0
# Run some setup code import numpy as np import matplotlib.pyplot as plt # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'ne...
jinzishuai/learn2deeplearn
deeplearning.ai/C4.CNN/week4_SpecialApps/hw/Face Recognition/Face Recognition for the Happy House - v2.ipynb
gpl-3.0
from keras.models import Sequential from keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate from keras.models import Model from keras.layers.normalization import BatchNormalization from keras.layers.pooling import MaxPooling2D, AveragePooling2D from keras.layers.merge import Concatenate from kera...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Introduction_to_Futures/notebook.ipynb
unlicense
import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Introduction to Futures Contracts by Maxwell Margenot and Delaney Mackenzie Part of the Quantopian Lecture Series: www.quantopian.com/lectures github.com/quantopian/research_public Notebook released under the Creative Commons Att...
ToqueWillot/M2DAC
FDMS/TME3/Kaggle_rain-Copy1.ipynb
gpl-2.0
# from __future__ import exam_success from __future__ import absolute_import from __future__ import print_function %matplotlib inline import sklearn import matplotlib.pyplot as plt import seaborn as sns import numpy as np import random import pandas as pd # Sk cheats from sklearn.cross_validation import cross_val_sco...
kkhenriquez/python-for-data-science
Week-4-Pandas/.ipynb_checkpoints/Introduction to Pandas-checkpoint.ipynb
mit
import pandas as pd """ Explanation: <p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold"><br> Pandas</p> <br> pandas is a Python library for data analysis. It offers a number of data exploration, cleaning and transformation operations that are critical in working with data in Python. pandas ...
AllenDowney/ThinkStats2
workshop/hypothesis.ipynb
gpl-3.0
%matplotlib inline import numpy import scipy.stats import matplotlib.pyplot as plt import first """ Explanation: Hypothesis Testing Copyright 2016 Allen Downey License: Creative Commons Attribution 4.0 International End of explanation """ live, firsts, others = first.MakeFrames() """ Explanation: Part One Suppos...
ameliecordier/iutdoua-info_algo2015
2015-10-08 - TD7 - Les algos mystères, le monde à l'envers .ipynb
cc0-1.0
a, b, c = 1, 1, 1 print(1) while c<15: a, b, c = b, a+b, c+1 print(b) """ Explanation: Exercice 1 : Que font les programmes suivants ? End of explanation """ a, b, c = 1, 1, 1 pri...
charmasaur/digbeta
tour/traj_feature.ipynb
gpl-3.0
%matplotlib inline import os import re import math import random import pickle import pandas as pd import numpy as np import scipy.stats #from numba import jit from datetime import datetime from joblib import Parallel, delayed import matplotlib.pyplot as plt nfeatures = 8 # number of features EPS = 1e-12 # smooth, de...
rsignell-usgs/notebook
OOI/from_ooi_json-pwrsys-deployment.ipynb
mit
%matplotlib inline import json import pandas as pd import numpy as np import glob from pyaxiom.netcdf.sensors import TimeSeries path = '/sand/usgs/users/rsignell/data/ooi/endurance/cg_proc/ce02shsm/D00004/buoy/pwrsys/*.pwrsys.json' odir = '/usgs/data2/notebook/data/nc' ofile = 'ce02shsm_pwrsys_D00004.nc' def json2df...
Automating-GIS-processes/2017
source/codes/Lesson5-interactive-map-Bokeh-advanced-plotting-published.ipynb
mit
from bokeh.palettes import YlOrRd as palette #Spectral6 as palette from bokeh.plotting import figure, save from bokeh.models import ColumnDataSource, HoverTool, LogColorMapper from bokeh.palettes import RdYlGn10 as palette import geopandas as gpd import pysal as ps import numpy as np # Filepaths fp = r"/home/geo/dat...
kubeflow/examples
kserve/sdk/first_isvc_kserve.ipynb
apache-2.0
!pip install kserve==0.7.0 """ Explanation: Run your first InferenceService The InferenceService custom resource is the primary interface that is used for deploying models on KServe. Inside an InferenceService, users can specify multiple components that are used for handling inference requests. These components are th...
jeanbaptistepriez/predicsis-ai-faq-tuto
1.how_to_retrieve_discretization_attributes_using_PredicSis.ai_python_SDK/How to retrieve classes, using PredicSis.ai python SDK.ipynb
gpl-3.0
# Load PredicSis.ai SDK from predicsis import PredicSis import predicsis.config as config, os, sys os.environ['PREDICSIS_URL'] = 'your_instance' if sys.version_info[0] >= 3: from importlib import reload reload(config) """ Explanation: Goal Retrieve the discretization attributes available in PredicSis.ai GUI usin...
cbuntain/TutorialSocialMediaCrisis
notebooks/T04-08 - Twitter Analytics.ipynb
apache-2.0
crisisInfo = { "boston": { "name": "Boston Marathon Bombing", "time": 1366051740, # Timestamp in seconds since 1/1/1970, UTC # 15 April 2013, 14:49 EDT -> 18:49 UTC "directory": "boston", "keywords": ["boston", "exploision", "bomb", "marathon"], "b...
marioberges/F16-12-752
homeworks/homework1/assignment1_solution.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import sys print('Python version:') print(sys.version) print('Numpy version:') print(np.__version__) import sklearn print('Sklearn version:') print(sklearn.__version__) """ Explanation: 12-752: Data-Driven Building Energy Management Fall 2016, Car...
wikistat/Apprentissage
Adult-Census/Apprent-Python-AdultCensus.ipynb
gpl-3.0
%matplotlib inline # Importations import matplotlib.pyplot as plt import pandas as pd import numpy as np adult=pd.read_csv('adultTrainTest.csv') adult.head() """ Explanation: <center> <a href="http://www.insa-toulouse.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/Wikistat/Images/logo-insa.jpg" style="float:...
eds-uga/csci1360e-su17
assignments/A4/A4_Q2.ipynb
mit
import numpy as np np.random.seed(578435) x11 = np.random.random(10) x12 = np.random.random(10) d1 = np.array([ 0.24542374, 0.19098998, 0.20645088, 0.49097139, -0.56594091, -0.13363814, 0.46859546, -0.32476466, -0.35938731, 0.17459786]) np.testing.assert_allclose(d1, difference(x11, x12)) np.random.seed(8...
morphean/deep-learning
linear-regression/Linear-Regression.ipynb
apache-2.0
import pandas as pd from sklearn import linear_model import matplotlib.pyplot as plt """ Explanation: Linear Regression This is one of the simplest models to use, since it has uses linearly correlated data to 'predict' a value given End of explanation """ df = pd.read_fwf('brain_body.txt') x_values = df[['Brain']] y...
pgmpy/pgmpy_notebook
notebooks/1. Introduction to Probabilistic Graphical Models.ipynb
mit
from IPython.display import Image """ Explanation: Introduction to Probabilitic Graphical Models End of explanation """ %run ../scripts/1/discretize.py data """ Explanation: Contents What is machine learning Different ways of learning from data Why probabilistic graphical models Major types of PGMs 1. What is mac...
smharper/openmc
examples/jupyter/candu.ipynb
mit
%matplotlib inline from math import pi, sin, cos import numpy as np import openmc """ Explanation: In this example, we will create a typical CANDU bundle with rings of fuel pins. At present, OpenMC does not have a specialized lattice for this type of fuel arrangement, so we must resort to manual creation of the array ...
arnoldlu/lisa
ipynb/tutorial/00_LisaInANutshell.ipynb
apache-2.0
import logging from conf import LisaLogging LisaLogging.setup() # Execute this cell to enable verbose SSH commands logging.getLogger('ssh').setLevel(logging.DEBUG) # Other python modules required by this notebook import json import os """ Explanation: Linux Interactive System Analysis DEMO Get LISA and start the Not...
GoogleCloudPlatform/python-docs-samples
people-and-planet-ai/image-classification/README.ipynb
apache-2.0
# We need libffi-dev to launch the Dataflow pipeline. !apt-get -qq install libffi-dev # Clone the python-docs-samples respository. !git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git # Navigate to the sample code directory. %cd python-docs-samples/people-and-planet-ai/image-classification # Ins...
lukas/ml-class
examples/notebooks/Lesson-4-Evaluating-Classifiers.ipynb
gpl-2.0
import pandas as pd import numpy as np df = pd.read_csv('../scikit/tweets.csv') text = df['tweet_text'] target = df['is_there_an_emotion_directed_at_a_brand_or_product'] # Remove the blank rows: fixed_target = target[pd.notnull(text)] fixed_text = text[pd.notnull(text)] # Perform feature extraction: from sklearn.fe...
ES-DOC/esdoc-jupyterhub
notebooks/awi/cmip6/models/awi-cm-1-0-hr/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'awi', 'awi-cm-1-0-hr', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: AWI Source ID: AWI-CM-1-0-HR Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy...
intel-analytics/BigDL
python/orca/colab-notebook/quickstart/pytorch_lenet_mnist_data_creator_func.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed un...
ajrichards/bayesian-examples
data-ingestion/db-stuff/sqlalchemy-stuff/sqlalchemy.ipynb
bsd-3-clause
import os,sys,getpass,datetime from sqlalchemy import Column, ForeignKey, Integer, String, Float, DateTime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker Base = declarative_base() class Membe...
InterImm/marsCalendar
py/.ipynb_checkpoints/calendar-checkpoint.ipynb
bsd-2-clause
import math import datetime ## to deal with dates from IPython.display import Image """ Explanation: 这是一个用来说明火星历法和地球历法换算方法的文档。 火星历法的说明:火星历法@星际移民之书 火星和地球之间,一个非常最要的联系是地球上 UTC 时间的 2000 年 01 月 06 日,这一天的午夜正好是火星上零度经线的午夜。因此,一个比较好的算法是,以这一天为基准。 最终要达成的目的是,给定一个地球上的 UTC 日期和时间,我们能够换算到火星的零度经线的日期和时间。 Prep End of explanation """ # ...
eecs445-f16/umich-eecs445-f16
handsOn_lecture11_info-theory-decision-trees/handsOn11.ipynb
mit
from sklearn.tree import DecisionTreeClassifier from sklearn.linear_model import LogisticRegression, Perceptron import numpy as np import matplotlib.pyplot as plt from mlxtend.evaluate import plot_decision_regions %matplotlib inline %config InlineBackend.figure_format = 'retina' """ Explanation: EECS 445: Machine Le...
mromanello/SunoikisisDC_NER
Sunoikisis - Named Entity Extraction 1b.ipynb
gpl-3.0
######## # NLTK # ######## import nltk from nltk.tag import StanfordNERTagger ######## # CLTK # ######## import cltk from cltk.tag.ner import tag_ner ############## # MyCapytain # ############## import MyCapytain from MyCapytain.resolvers.cts.api import HttpCTSResolver from MyCapytain.retrievers.cts5 import CTS from M...
wittawatj/fsic-test
ipynb/demo_nfsic.ipynb
mit
%load_ext autoreload %autoreload 2 %matplotlib inline import fsic.util as util import fsic.data as data import fsic.kernel as kernel import fsic.indtest as it import fsic.glo as glo import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats import scipy import theano """ Explanation: Introduction ...
tensorflow/docs-l10n
site/ja/hub/tutorials/text_classification_with_tf_hub.ipynb
apache-2.0
# Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
relopezbriega/mi-python-blog
content/notebooks/ComplexPy.ipynb
gpl-2.0
# Creando un número complejo c1 = 4 + 3j c1 # Verificando el tipo de dato type(c1) # Creando un número complejo con complex c2 = complex(2, -3) c2 # sumando dos números complejos c1 = 2 + 2j c2 = 1 + 5j c1 + c2 # Restando dos números complejos c1 - c2 # Producto escalar c1 = 2 + 3j 3 * c1 # Multiplicando dos núme...
fastai/course-v3
nbs/dl2/pascal.ipynb
apache-2.0
path = untar_data(URLs.PASCAL_2007) """ Explanation: Data We are going to use the Pascal dataset for object detection. There is a version from 2007 and a bigger version from 2012. We'll use the 2007 version here. End of explanation """ import json annots = json.load(open(path/'train.json')) annots.keys() annots['a...
tzdwi/adapt
workflow.ipynb
mit
#Now, let's import some useful libraries import numpy as np from matplotlib import pyplot as plt from adapt import * from phot_tools import * from glob import glob import os from astropy.io import fits from astropy.coordinates import SkyCoord from astropy.table import vstack, Table %matplotlib inline #What do all of t...
NeuPhysics/aNN
ipynb/HomogeneousModel.ipynb
mit
# This line configures matplotlib to show figures embedded in the notebook, # instead of opening a new window for each figure. More about that later. # If you are using an old version of IPython, try using '%pylab inline' instead. %matplotlib inline %load_ext snakeviz import numpy as np from scipy.optimize import mi...
tlapicka/IPythonNotebooks
Harmonicka_analyza--trojuhelnik.ipynb
gpl-2.0
t=linspace(0,1,1000) u1=8./pi/pi*cos(2*pi*1*t-pi/2) u3=8./3/3/pi/pi*cos(2*pi*3*t+pi/2) u5=8./5/5/pi/pi*cos(2*pi*5*t-pi/2) u7=8./7/7/pi/pi*cos(2*pi*7*t+pi/2) """ Explanation: Součet harmonických složek Mějme následující časový průběh: $$ u(t)=\frac{8}{\pi^2} \cos(\omega t - {\pi\over 2}) + \frac{8}{(3\pi)^2} \cos(3\om...
chemiskyy/simmit
Examples/MMSP/micromechanics_examples/micro_examples1.ipynb
gpl-3.0
%matplotlib inline import numpy as np from numpy.linalg import inv import pandas as pd import matplotlib.pyplot as plt from simmit import smartplus as sim from simmit import identify as iden import os import itertools dir = os.path.dirname(os.path.realpath('__file__')) """ Explanation: Mechanical properties of compo...
cgpotts/cs224u
iit_equality.ipynb
apache-2.0
__author__ = "Atticus Geiger" __version__ = "CS224u, Stanford, Spring 2022" """ Explanation: Interchange Intervention Training: Equality learning tasks End of explanation """ import torch import random import copy import itertools import numpy as np from sklearn.metrics import classification_report from torch_deep_n...
psumank/DATA643
Final/DATA643_pySpark_Final_Project.ipynb
mit
import os import sys import urllib2 import collections import matplotlib.pyplot as plt import math from time import time, sleep %pylab inline """ Explanation: DATA 643 - Final Project Sreejaya Nair and Suman K Polavarapu Description: Explore the Apache Spark Cluster Computing Framework by analysing the movielens datas...
CivicKnowledge/metatab-packages
ipums.org/ipums.org-income_homevalue/notebooks/executed-source.ipynb
mit
%matplotlib inline %load_ext metatab %load_ext autoreload %autoreload 2 %mt_lib_dir lib import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np import metatab as mt import seaborn as sns; sns.set(color_codes=True) import sqlite3 import statsmodels as sm from statsmodels.nonpara...
llulai/deep-learning
image-classification/dlnd_image_classification.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' # Use Floyd's cifar-10 dataset if present floyd_cifar10...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160704월_24일차_모형 최적화 Model optimization/2.모형 최적화 분산 처리.ipynb
mit
from ipyparallel import Client c = Client() c.ids dview = c[:] dview """ Explanation: 모형 최적화 분산 처리 ipyparallel http://ipyparallel.readthedocs.org/en/latest/index.html Engine <-> Client Engine: 실제 계산이 실행되는 프로세스 Client: 엔진을 제어하기 위한 인터페이스 $ conda install ipyparallel Engine 가동/중지 가동 $ ipcluster start -n 4 중지 ...
ES-DOC/esdoc-jupyterhub
notebooks/csiro-bom/cmip6/models/access-1-0/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'csiro-bom', 'access-1-0', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: CSIRO-BOM Source ID: ACCESS-1-0 Topic: Aerosol Sub-Topics: Transport, Emis...
dcavar/python-tutorial-for-ipython
notebooks/Python for Text Similarities.ipynb
apache-2.0
text1 = """Our medicine cures baldness. No diagnostics needed. We guarantee Fast Viagra delivery. We can provide Human growth hormone. The cheapest Life Insurance with us. You can Lose weight with this treatment. Our Medicine now and No medical exams necessary. Our...
kadircet/CENG
783/HW2/task1_denoising_autoencoder.ipynb
gpl-3.0
# A bit of setup import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' # for auto-reloading external modules # see http://stackoverflow.com/ques...
eflegara/NetStruc
5. Viral marketing on social media.ipynb
mit
import networkx as nx #import NetworkX import numpy as np #import numpy for ... #force drawing of graphs inline for ipython notebook %matplotlib inline import matplotlib.pyplot as plt #import matplotlib for plotting/drawing grpahs import matplotlib.patches as mpatches #for legends in the graph from __future__ import u...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/structured/labs/3c_bqml_dnn_babyweight.ipynb
apache-2.0
%%bash sudo pip freeze | grep google-cloud-bigquery==1.6.1 || \ sudo pip install google-cloud-bigquery==1.6.1 """ Explanation: LAB 3c: BigQuery ML Model Deep Neural Network. Learning Objectives Create and evaluate DNN model with BigQuery ML Create and evaluate DNN model with feature engineering with ML.TRANSFORM. Ca...
VadimMalykh/courses
deeplearning1/my/lessons/lesson1_my.ipynb
apache-2.0
%matplotlib inline """ Explanation: Using Convolutional Neural Networks Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning. Introduction to this week's task: 'Do...
ewulczyn/talk_page_abuse
src/retention/Harassment and Newcomer Retention Data Munging.ipynb
apache-2.0
df_all_users = pd.read_csv("../../data/retention/user_start.tsv", "\t") print(df_all_users.shape) print(len(df_all_users.user_id.unique())) # load data for resolving user pagetitles to user_ids # only works for ns=user df_i2ns = pd.read_csv("../../data/retention/user_id_to_names.tsv", "\t") print(df_i2ns.shape) # can...
michaelgat/Udacity_DL
intro-to-tensorflow/intro_to_tensorflow_MG.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...
JackWalpole/splitwavepy
devel/Splitting_for_novices.ipynb
mit
import sys sys.path.append("..") import splitwavepy as sw import matplotlib.pyplot as plt import numpy as np data = sw.Pair(noise=0.05,pol=40,delta=0.1) data.plot() """ Explanation: Shear Wave Splitting for the Novice When a shear wave encounters an anisotropic medium, it splits its energy into orthogonally polaris...
yw-fang/readingnotes
machine-learning/McKinney-pythonbook2013/chapter05-note.ipynb
apache-2.0
from pandas import Series, DataFrame import pandas as pd """ Explanation: 阅读笔记 作者:方跃文 Email: fyuewen@gmail.com 时间:始于2017年9月12日, 结束写作于 第五章笔记始于2018年1月6日,结束于2018年July 20th 这一章节虽然跨度很长,不过在1月到7月之间,pandas估计已经被上百次地应用到了我地实际研究中用于数据处理. The note on this chapter was finally finished today, I was quite happy because it has ...
gboeing/pynamical
examples/pynamical-demo-cobweb-plots.ipynb
mit
import glob import IPython.display as IPdisplay import matplotlib.pyplot as plt import numpy as np import pandas as pd from pynamical import cobweb_plot from PIL import Image %matplotlib inline """ Explanation: Pynamical: cobweb plots of the logistic map Citation info: Boeing, G. 2016. "Visual Analysis of Nonlinear Dy...
opengeostat/pygslib
pygslib/Ipython_templates/declus_raw.ipynb
mit
#general imports import matplotlib.pyplot as plt import pygslib import numpy as np #make the plots inline %matplotlib inline """ Explanation: PyGSLIB Declustering This is how declustering works End of explanation """ #get the data in gslib format into a pandas Dataframe mydata= pygslib.gslib.read_gslib_file(...
GLiCom/CorpusAnalysis2016
notebooks/Introduction.ipynb
apache-2.0
import nltk nltk.download('book') """ Explanation: Pequeña introducción a NLTK o cómo analizar un corpus propio Primer paso: preparar utilización de NLTK (detalles sin importancia). Con import se definen lo módulos que se quieren usar. nltk.download('book') nos permite descargar varios recursos lingüísticos y corpus (...
balarsen/pymc_learning
Learning/SABRS_demo_stats1.ipynb
bsd-3-clause
!date # Standard Library Python Modules # Common Python Modules import matplotlib.pyplot as plt import numpy as np import spacepy.plot as spp import spacepy.toolbox as tb import pandas as pd import pymc # this is the MCMC tool # put plots into this document %matplotlib inline """ Explanation: Brian Larsen - 28 Apri...
alasdairtran/mclearn
projects/peerjcs16/active_learning_suggestions.ipynb
bsd-3-clause
%load_ext autoreload %autoreload 2 import pandas as pd import os import matplotlib.pyplot as plt import numpy as np import seaborn as sns from time import time from mclearn.experiment import ActiveExperiment, load_results, save_results from mclearn.tools import log from sklearn.externals import joblib from matplotlib....
AtmaMani/pyChakras
python_crash_course/python_cheat_sheet_2.ipynb
mit
def func_add_numbers(num1, num2=10): return (num1 + num2) func_add_numbers(2) func_add_numbers(2,34) func_add_numbers() """ Explanation: Python cheat sheet - iterations Table of contents - Functions - Classes - Exception handling Functions Specify optional parameters in the end. Specify the default values fo...
ericmjl/influenza-global-reassortment
Revisions - Lineage Traces.ipynb
mit
import networkx as nx import matplotlib.pyplot as plt import numpy as np import pandas as pd import json from collections import defaultdict from datetime import datetime, date from random import randint from networkx.readwrite.json_graph import node_link_data %matplotlib inline G = nx.read_gpickle('20150902_all_ird...
evanmiltenburg/python-for-text-analysis
Chapters-colab/Chapter_08_Comparison_of_lists_and_sets.ipynb
apache-2.0
%%capture !wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Data.zip !wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/images.zip !wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Extra_Material.zip !unzip Data.zip -d ../ !unzip images.zip -d ./ !unzip Ext...
tensorflow/lattice
docs/tutorials/shape_constraints.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...
pauliacomi/pyGAPS
docs/examples/quickstart.ipynb
mit
import pygaps as pg """ Explanation: Quickstart This document should get you started with pyGAPS, providing several common operations like creating/reading isotherms, running characterisation routines, model fitting and data export/plotting. <div class="alert alert-info"> You can download this code as a Jupyter Notebo...
JAmarel/Phys202
Matplotlib/MatplotlibEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 1 Imports End of explanation """ import os assert os.path.isfile('yearssn.dat') """ Explanation: Line plot of sunspot data Download the .txt data for the "Yearly mean total sunspot number [1700 - now]" from th...
eflautt/ga-data-science
AdmissionsProject/Part3/starter-code/Flautt-project3-submission.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import pandas as pd import statsmodels.api as sm import pylab as pl import numpy as np df_raw = pd.read_csv("../assets/admissions.csv") df = df_raw.dropna() print df_raw.count() # showing 'old' df total count print df.count() # showing 'new' df total count print df....
jonwright/ImageD11
docs/NotesOnNewDeformationGradientTensor.ipynb
gpl-2.0
%matplotlib inline import matplotlib.pyplot as pl, numpy as np """ Explanation: Finite strains A quick notebook to try to reduce the problem to looking at some simple pictures. There seems to be a lot more than one way to define the strain tensor components. We use a 2D example for now so it is easier to draw pictur...
balarsen/pymc_learning
Jeffreys prior/Jeffreys prior examples.ipynb
bsd-3-clause
import pymc3 as pm import theano import numpy as np import scipy.stats as ss import seaborn as sns sns.set(font_scale=1.5) """ Explanation: This notebook is meant to capture experience with Jeffery's Priors https://en.wikipedia.org/wiki/Jeffreys_prior End of explanation """ data = np.random.normal(10, 2, size=20) s...
dormouse/laketai
.ipynb_checkpoints/pyqt5_qsetting_note-checkpoint.ipynb
gpl-2.0
from PyQt5.QtCore import QSettings """ Explanation: PyQt5 QSettings Note 保存应用窗口大小和位置的例子 ``` def read_settings(self): settings = QSettings("Dormouse", "LakeTai") pos = settings.value("pos", QPoint(200, 200)) size = settings.value("size", QSize(400, 400)) self.resize(size) sel...
Jackporter415/phys202-2015-work
assignments/assignment06/InteractEx05.ipynb
mit
from matplotlib import pyplot as plt import numpy as np from IPython.display import SVG from IPython.display import display from IPython.html.widgets import interactive, fixed """ Explanation: Interact Exercise 5 Imports Put the standard imports for Matplotlib, Numpy and the IPython widgets in the following cell. End ...
Vvkmnn/books
AutomateTheBoringStuffWithPython/lesson20.ipynb
gpl-3.0
spam = 'Hello World!' print(spam) print(spam.upper()) print(spam.lower()) print(spam) # variable is unmodified """ Explanation: Lesson 20: String Methods String methods, unlike list methods, return new strings, not changed strings. This is because strings are immutable. .lower() and .upper() are methods that return ...
AllenDowney/ThinkBayes2
notebooks/chap07.ipynb
mit
# If we're running on Colab, install empiricaldist # https://pypi.org/project/empiricaldist/ import sys IN_COLAB = 'google.colab' in sys.modules if IN_COLAB: !pip install empiricaldist # Get utils.py from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename...
AbhilashReddyM/GeometricMultigrid
.ipynb_checkpoints/Making_a_Preconditioner-checkpoint.ipynb
mit
import numpy as np """ Explanation: The Making of a Preconditioner This is a demonstration of a multigrid preconditioned krylov solver in python3. The code and more examples are present on github here. The problem solved is a Poisson equation on a rectangular domain with homogenous dirichlet boundary conditions. Fini...
csc-training/python-introduction
notebooks/answers/7 - NumPy.ipynb
mit
a = np.arange(-2, 2, 0.2) print(a) """ Explanation: Exercises Simple array manipulation Investigate the behavior of the statements below by looking at the values of the arrays a and b after assignments: a = np.arange(5) b = a b[2] = -1 b = a[:] b[1] = -1 b = a.copy() b[0] = -1 Generate a 1D NumPy array containing numb...
jegibbs/phys202-2015-work
assignments/assignment03/NumpyEx04.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns """ Explanation: Numpy Exercise 4 Imports End of explanation """ import networkx as nx K_5=nx.complete_graph(5) nx.draw(K_5) """ Explanation: Complete graph Laplacian In discrete mathematics a Graph is a set of vertices or n...
dolittle007/dolittle007.github.io
notebooks/GLM-hierarchical-advi-minibatch.ipynb
gpl-3.0
%matplotlib inline import theano theano.config.floatX = 'float64' import matplotlib.pyplot as plt import numpy as np import pymc3 as pm import pandas as pd data = pd.read_csv(pm.get_data('radon.csv')) county_names = data.county.unique() county_idx = data['county_code'].values n_counties = len(data.county.unique()) ...
HrantDavtyan/Data_Scraping
Week 6/Scrapy_3.ipynb
apache-2.0
# -*- coding: utf-8 -*- import scrapy class QuoteSpider(scrapy.Spider): name = "quote" allowed_domains = ["quotes.toscrape.com"] start_urls = ['http://quotes.toscrape.com/page/1/', 'http://quotes.toscrape.com/page/2/'] def parse(self, response): for quote in response.css('di...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/sandbox-1/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-1', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: NCC Source ID: SANDBOX-1 Topic: Ocnbgchem Sub-Topics: Tracers. Properties: 6...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session05/Day2/GalaxyPhotometry.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from astropy.io import fits %matplotlib notebook """ Explanation: Galaxy photometry Version 0.1 Today our goal is to compute the 1D radial profile of a simulated galaxy. While many software packages exist to do this, we will build this same functionality from scratch...
csiu/100daysofcode
lol/acquiring-data.ipynb
mit
website_base_stats = "http://leagueoflegends.wikia.com/wiki/Base_champion_statistics" # Save HTML to soup html_data = requests.get(website_base_stats).text soup = BeautifulSoup(html_data, "html5lib") # Parse table table = soup.find('table', attrs={'class' : 'wikitable'}) # Parse table header lol_thead = [h.text.stri...
AllenDowney/ThinkStats2
solutions/chap10soln.ipynb
gpl-3.0
from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename): from urllib.request import urlretrieve local, _ = urlretrieve(url, filename) print("Downloaded " + local) download("https://github.com/AllenDowney/ThinkStats2/raw/master/code/th...
azogue/esiosdata
notebooks/esiosdata - Facturación.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import matplotlib.pyplot as plt from esiosdata import FacturaElec from esiosdata.facturapvpc import (TIPO_PEAJE_GEN, TIPO_PEAJE_NOC, TIPO_PEAJE_VHC, ZONA_IMPUESTOS_PENIN_BALEARES, ZONA_IMPUESTOS_CANARIAS) from esiosdat...
ajaybhat/DLND
Project 2/dlnd_image_classification.ipynb
apache-2.0
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile import sklearn import numpy as np import time import pylab as pl from IPython import display cifar10_dataset...
Thomas-Schatz/vowel-discri
vowel_discri/Generating acoustic predictors for effect sizes.ipynb
mit
# Requirements: # - sox + soundfile + our vowel_discri package # - ABXpy.distances (could be made independent from ABXpy) import soundfile import os import os.path as path import pandas as pd import numpy as np import seaborn from ast import literal_eval as make_tuple import wave import subprocess import shutil #...