repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
tensorflow/docs-l10n | site/en-snapshot/quantum/tutorials/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... |
gaufung/PythonStandardLibrary | cryptography/Hashlib.ipynb | mit | import hashlib
print('Guaranteed:\n{}\n'.format(
', '.join(sorted(hashlib.algorithms_guaranteed))))
print('Available:\n{}'.format(
', '.join(sorted(hashlib.algorithms_available))))
import hashlib
lorem = '''Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore ... |
Unidata/unidata-python-workshop | notebooks/MetPy_Advanced/Isentropic Analysis.ipynb | mit | from siphon.catalog import TDSCatalog
cat = TDSCatalog('http://thredds.ucar.edu/thredds/catalog/grib/'
'NCEP/GFS/Global_0p5deg/catalog.xml')
best = cat.datasets['Best GFS Half Degree Forecast Time Series']
"""
Explanation: <a name="top"></a>
<div style="width:1000 px">
<div style="float:right; width... |
zizouvb/deeplearning | language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
open-forcefield-group/openforcefield | examples/deprecated/host_guest_simulation/smirnoff_host_guest.ipynb | mit | # NBVAL_SKIP
from openeye import oechem # OpenEye Python toolkits
import oenotebook as oenb
# Check license
print("Is your OEChem licensed? ", oechem.OEChemIsLicensed())
from openeye import oeomega # Omega toolkit
from openeye import oequacpac #Charge toolkit
from openeye import oedocking # Docking toolkit
from oeommto... |
CGATOxford/CGATPipelines | CGATPipelines/pipeline_docs/pipeline_peakcalling/notebooks/template_peakcalling_peakstats.ipynb | mit | import sqlite3
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
#import CGATPipelines.Pipeline as P
import os
import statistics
#import collections
#load R and the R packages required
#%load_ext rpy2.ipython
#%R require(ggplot2)
# use the... |
hetaodie/hetaodie.github.io | assets/media/uda-ml/deep/shensd/IMDB数据/.ipynb_checkpoints/IMDB_In_Keras-zh-checkpoint.ipynb | mit | # Imports
import numpy as np
import keras
from keras.datasets import imdb
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.preprocessing.text import Tokenizer
import matplotlib.pyplot as plt
%matplotlib inline
np.random.seed(42)
"""
Explanation: 使用 Keras 分析 IMDB 电影数据
... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_ml/ml_ccc_machine_learning_interpretabilite.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
# Répare une incompatibilité entre scipy 1.0 et statsmodels 0.8.
from pymyinstall.fix import fix_scipy10_for_statsmodels08
fix_scipy10_for_statsmodels08()
"""
Explanation: 2A.ml - Interprétabilité et corrélations des variables
Plus un modèle de machine l... |
pagutierrez/tutorial-sklearn | notebooks-spanish/14-complejidad_modelos_busqueda_grid.ipynb | cc0-1.0 | from sklearn.model_selection import cross_val_score, KFold
from sklearn.neighbors import KNeighborsRegressor
# Generamos un dataset sintético:
x = np.linspace(-3, 3, 100)
rng = np.random.RandomState(42)
y = np.sin(4 * x) + x + rng.normal(size=len(x))
X = x[:, np.newaxis]
cv = KFold(shuffle=True)
# Para cada parámetro... |
Zhenxingzhang/AnalyticsVidhya | Articles/12_Useful_Pandas_Techniques_in_Python_for_Data_Manipulation/PythonTipsNTricks.ipynb | apache-2.0 | import pandas as pd
import numpy as np
data = pd.read_csv("train.csv", index_col="Loan_ID")
# test = pd.read_csv("test.csv", index_col="PassengerID")
print data.shape
data.columns
"""
Explanation: 12 Useful Pandas Techniques to add to your Arsenal!!
Introduction
If you are reading this article, I'm sure you love stati... |
Kaggle/learntools | notebooks/deep_learning_intro/raw/ex3.ipynb | apache-2.0 | # Setup plotting
import matplotlib.pyplot as plt
from learntools.deep_learning_intro.dltools import animate_sgd
plt.style.use('seaborn-whitegrid')
# Set Matplotlib defaults
plt.rc('figure', autolayout=True)
plt.rc('axes', labelweight='bold', labelsize='large',
titleweight='bold', titlesize=18, titlepad=10)
plt.r... |
quoniammm/happy-machine-learning | Udacity-ML/titanic_survival_exploration-master_0/titanic_survival_exploration.ipynb | mit | import numpy as np
import pandas as pd
# RMS Titanic data visualization code
# 数据可视化代码
from titanic_visualizations import survival_stats
from IPython.display import display
%matplotlib inline
# Load the dataset
# 加载数据集
in_file = 'titanic_data.csv'
full_data = pd.read_csv(in_file)
# Print the first few entries of t... |
danielballan/docker-demo-images | notebooks/communities/pyladies/Python 101.ipynb | bsd-3-clause | 1 + 1
3 / 4 # caution: in Python 2 the result will be an integer
7 ** 3
"""
Explanation: Welcome to Python 101
<a href="http://pyladies.org"><img align="right" src="http://www.pyladies.com/assets/images/pylady_geek.png" alt="Pyladies" style="position:relative;top:-80px;right:30px;height:50px;" /></a>
Welcome! This ... |
whitead/numerical_stats | unit_6/hw_2019/Homework_6_key.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
import numpy as np
from scipy.special import comb, factorial
n = np.arange(10)
mu = 3
p = mu**n * np.exp(-mu) / factorial(n)
plt.xlabel('Number of Deer [$n$]')
plt.ylabel('P(n)')
plt.plot(n, p, '-o')
plt.show()
"""
Explanation: Homework 6
CHE 116: Numerical Methods and Statistics
2/21/... |
mne-tools/mne-tools.github.io | dev/_downloads/c4c1adf6983ad491e45e3941a0c10d6e/time_frequency_mixed_norm_inverse.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
#
# License: BSD-3-Clause
import numpy as np
import mne
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse
from mne.inverse_sparse import tf_mixed_nor... |
COHRINT/cops_and_robots | resources/notebooks/spacy/.ipynb_checkpoints/00_spacy-checkpoint.ipynb | apache-2.0 | from __future__ import unicode_literals # If Python 2
import spacy.en
from spacy.tokens import Token
from spacy.parts_of_speech import ADV
nlp = spacy.en.English()
# Find log probability of Nth most frequent word
probs = [lex.prob for lex in nlp.vocab]
probs.sort()
words = [w for w in nlp.vocab if w.has_repvec]
"""
... |
deepmind/deepmind-research | causal_reasoning/Causal_Reasoning_in_Probability_Trees.ipynb | apache-2.0 | !apt-get install graphviz
!pip install graphviz
"""
Explanation: Copyright 2020 DeepMind Technologies Limited.
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... |
w0nk0/LSTMtest1 | keras save-load tests-cleaned.ipynb | gpl-2.0 | lstmcopy = model_from_yaml(lstmyaml)
print(lstmcopy.evaluate(trainX,trainy,show_accuracy=True))
lstmweights=lstmmodel.get_weights()
lstmcopy.set_weights(lstmweights)
print("Original:", lstmmodel.evaluate(trainX,trainy,show_accuracy=True))
print("Copy:",lstmcopy.evaluate(trainX,trainy,show_accuracy=True))
"""
Explanat... |
nreimers/deeplearning4nlp-tutorial | 2015-10_Lecture/Lecture2/code/1_Intro_Theano.ipynb | apache-2.0 | import theano
import theano.tensor as T
#Put your code here
"""
Explanation: Introduction to Theano
For a Theano tutorial please see: http://deeplearning.net/software/theano/tutorial/index.html
Basic Operations
For more details see: http://deeplearning.net/software/theano/tutorial/adding.html
Task: Use Theano to com... |
cmorgan/pysystemtrade | examples/introduction/asimpletradingrule.ipynb | gpl-3.0 | from sysdata.csvdata import csvFuturesData
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Simple Trading Rule
End of explanation
"""
data = csvFuturesData()
data
"""
Explanation: Work up a minimum example of a trend following system
Let's get some data
We can get data from various places; howe... |
mathLab/RBniCS | tutorials/02_elastic_block/tutorial_elastic_block.ipynb | lgpl-3.0 | from dolfin import *
from rbnics import *
"""
Explanation: TUTORIAL 02 - Elastic block problem
Keywords: POD-Galerkin method, vector problem
1. Introduction
In this Tutorial we consider a linear elasticity problem in a two-dimensional square domain $\Omega$.
The domain is partioned in nine square subdomains, as in the... |
pierresendorek/tensorflow_crescendo | simplest working tensorflow notebook ever.ipynb | lgpl-3.0 | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import math
"""
Explanation: Simplest Working Tensorflow Notebook Ever
End of explanation
"""
# The true value of the coefficients, which we will estimate hereafter
a_true, b_true = 1.3, -0.7
n_sample = 1000
"""
Explanati... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/introduction_to_tensorflow/labs/4_keras_functional_api.ipynb | apache-2.0 | import datetime
import os
import shutil
import numpy as np
import pandas as pd
import tensorflow as tf
from matplotlib import pyplot as plt
from tensorflow import feature_column as fc
from tensorflow import keras
from tensorflow.keras import Model
from tensorflow.keras.callbacks import TensorBoard
from tensorflow.kera... |
martinggww/lucasenlights | MachineLearning/DataScience-Python3/TrainTest.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
from pylab import *
np.random.seed(2)
pageSpeeds = np.random.normal(3.0, 1.0, 100)
purchaseAmount = np.random.normal(50.0, 30.0, 100) / pageSpeeds
scatter(pageSpeeds, purchaseAmount)
"""
Explanation: Train / Test
We'll start by creating some data set that we want to build a mo... |
eflautt/ga-data-science | AdmissionsProject/Part2/starter-code/Flautt-project2-submission.ipynb | mit | #imports
from __future__ import division
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
import pylab as pl
import numpy as np
%matplotlib inline
"""
Explanation: Project 2
In this project, you will implement the exploratory analysis plan developed in Project 1. This... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/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', 'cmcc', 'sandbox-3', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: CMCC
Source ID: SANDBOX-3
Sub-Topics: Radiative Forcings.
Properties: 85 (42 ... |
mikekestemont/ghent1516 | Chapter 7 - More on Loops.ipynb | mit | for i in range(10):
print(i)
"""
Explanation: Chapter 7: More on Loops
In the previous chapters we have often discussed the powerful concept of looping in Python. Using loops, we can easily repeat certain actions when coding. With for-loops, for instance, it is really easy to visit the items in a list in a list an... |
DominikDitoIvosevic/Uni | STRUCE/2018/.ipynb_checkpoints/SU-2018-LAB05-0036477171-checkpoint.ipynb | mit | # Učitaj osnovne biblioteke...
import sklearn
import codecs
import mlutils
import matplotlib.pyplot as plt
import pgmpy as pgm
%pylab inline
"""
Explanation: Sveučilište u Zagrebu
Fakultet elektrotehnike i računarstva
Strojno učenje 2018/2019
http://www.fer.unizg.hr/predmet/su
Laboratorijska vježba 5: Probabilistič... |
dxwils3/machine_learning | neural_networks/MNIST_keras.ipynb | mit | from __future__ import print_function
from __future__ import division
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2... |
solvebio/solvebio-python | examples/generating_icgc_survival_curves.ipynb | mit | from solvebio import login, Dataset, Filter
import plotly.plotly as py
import plotly.tools as tls
from plotly.graph_objs import *
# Load local SolveBio credentials
login()
"""
Explanation: Advanced SolveBio Tutorial
2016-11-01 Generating survival curves by cancer type
NOTE: This page may not load optimally in GitHuB.... |
AllenDowney/ModSimPy | soln/chap15soln.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... |
drivendata/benchmarks | dengue-benchmark-statsmodels.ipynb | mit | %matplotlib inline
from __future__ import print_function
from __future__ import division
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
import statsmodels.api as sm
# just for the sake of this blog post!
from wa... |
azhurb/deep-learning | tensorboard/Anna_KaRNNa_Name_Scoped.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
IS-ENES-Data/submission_forms | test/workflow-demo.ipynb | apache-2.0 | # do this in case you want to change imported module code while working with this notebook
# -- (for development and testing puposes only)
%load_ext autoreload
%autoreload 2
# to generate empyty project form including all options for variables
# e.g.:
ACTIVITY_STATUS = "0:open, 1:in-progress ,2:action-required, 3:pau... |
chris-jd/udacity | intro_to_DS_assignment/Assignment 1 Submission Notebook.ipynb | mit | # Imports
# Numeric Packages
from __future__ import division
import numpy as np
import pandas as pd
import scipy.stats as sps
# Plotting packages
import matplotlib.pyplot as plt
from matplotlib import ticker
import seaborn as sns
%matplotlib inline
sns.set_style('whitegrid')
sns.set_context('talk')
# Other
from date... |
makeyourowntextminingtoolkit/makeyourowntextminingtoolkit | A01_singular_value_decomposition.ipynb | gpl-2.0 | # import numpy for SVD function
import numpy
# import matplotlib.pyplot for visualising arrays
import matplotlib.pyplot as plt
"""
Explanation: Learning About the Singular Value Decomposition
This notebook explores the Singular Value Decomposition (SVD)
End of explanation
"""
# create a really simple matrix
A = nump... |
mzszym/oedes | examples/scl/scl-trapping.ipynb | agpl-3.0 | %matplotlib inline
import matplotlib.pylab as plt
import oedes
import numpy as np
oedes.init_notebook() # for displaying progress bars
"""
Explanation: Steady-state space-charge-limited current with traps
This example shows how to simulate effects of a single trap level on current-voltage characteristics of a single ... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_eco/TD2A_eco_les_API.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.eco - API, API REST
Petite revue d'API REST.
End of explanation
"""
import requests
data_json = requests.get("http://api.worldbank.org/v2/countries?incomeLevel=LMC&format=json").json()
data_json
data_json[0]
# On voit qu'il y a nous... |
brian-rose/ClimateModeling_courseware | Lectures/Lecture04 -- Intro to CLIMLAB.ipynb | mit | # Ensure compatibility with Python 2 and 3
from __future__ import print_function, division
"""
Explanation: ATM 623: Climate Modeling
Brian E. J. Rose, University at Albany
Lecture 4: Building simple climate models using climlab
Warning: content out of date and not maintained
You really should be looking at The Clima... |
idekerlab/graph-services | notebooks/DEMO.ipynb | mit | # Tested on:
!python --version
"""
Explanation: cxMate Service DEMO
By Ayato Shimada, Mitsuhiro Eto
This DEMO shows
1. detect communities using an igraph's community detection algorithm
2. paint communities (nodes and edges) in different colors
3. perform layout using graph-tool's sfdp algorithm
End of explanation
"""... |
comp-journalism/Baseline_Problem_for_Algorithm_Audits | Statistics.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
%matplotlib inline
plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = (15, 3)
plt.rcParams['font.family'] = 'sans-serif'
pd.set_option('display.width', 5000)
pd.set_option('display.max_columns', 60)
HC_baseline = p... |
ricklupton/ipysankeywidget | examples/More examples.ipynb | mit | from ipysankeywidget import SankeyWidget
from ipywidgets import Layout
"""
Explanation: More examples
<i class="fa fa-2x fa-paper-plane text-info fa-fw"> </i> Simple example
<i class="fa fa-2x fa-space-shuttle text-info fa-fw"> </i> Advanced examples
<i class="fa fa-2x fa-link text-info fa-fw"> </i> Linking and Layou... |
trangel/Data-Science | reinforcement_learning/practice_reinforce.ipynb | gpl-3.0 | # This code creates a virtual display to draw game images on.
# If you are running locally, just ignore it
import os
if type(os.environ.get("DISPLAY")) is not str or len(os.environ.get("DISPLAY")) == 0:
!bash ../xvfb start
os.environ['DISPLAY'] = ':1'
import gym
import numpy as np, pandas as pd
import matplo... |
cchwala/pycomlink | notebooks/outdated_notebooks/Use CML data from CSV file.ipynb | bsd-3-clause | df = pd.read_csv('example_data/gap0_gap4_2012.csv', parse_dates=True, index_col=0)
df.head()
"""
Explanation: All the work you do with pycomlink will be based on the Comlink object, which represents one CML between two sites and with an arbitrary number of channels, i.e. the different connections between the two site... |
jegibbs/phys202-2015-work | assignments/assignment05/InteractEx01.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
from IPython.html import widgets
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
"""Print the sum ... |
mehmetcanbudak/JupyterWorkflow | JupyterWorkflow3.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
plt.style.use("seaborn")
from jupyterworkflow.data import get_fremont_data
data = get_fremont_data()
data.head()
data.resample("W").sum().plot()
data.groupby(data.index.time).mean().plot()
pivoted = data.pivot_table("Total", index=data.index.time, columns=data.ind... |
mbeyeler/opencv-machine-learning | notebooks/05.02-Using-Decision-Trees-to-Diagnose-Breast-Cancer.ipynb | mit | from sklearn import datasets
data = datasets.load_breast_cancer()
"""
Explanation: <!--BOOK_INFORMATION-->
<a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><img align="left" src="data/cover.jpg" style="width: 76px; height: 100px; background: white; padding: ... |
cerinunn/pdart | getting_started.ipynb | lgpl-3.0 |
%pylab inline
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
from datetime import timedelta
from obspy.core import read
from obspy.core.utcdatetime import UTCDateTime
from obspy.core.inventory import read_inventory
impo... |
harmsm/pythonic-science | chapters/06_image-analysis/00_intro-to-images.ipynb | unlicense | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
"""
Explanation: Manipulating Images in Python
End of explanation
"""
from PIL import Image
"""
Explanation: The Python Image Library (PIL)
End of explanation
"""
img = Image.open("img/colonies.jpg")
plt.imshow(img)
"""
Explanation: You c... |
joelgrus/codefellows-data-science-week | ipynb/matplotlib.ipynb | unlicense | import matplotlib.pyplot as plt
"""
Explanation: When working with matplotlib we usually do
End of explanation
"""
%matplotlib inline
"""
Explanation: and then some magic to get plots to show up here
End of explanation
"""
plt.plot([1,3],[2,4])
plt.title("This is just a sample graph")
plt.xlabel("This is just an ... |
jmschrei/pomegranate | benchmarks/pomegranate_vs_hmmlearn.ipynb | mit | %pylab inline
import hmmlearn, pomegranate, time, seaborn
from hmmlearn.hmm import *
from pomegranate import *
seaborn.set_style('whitegrid')
"""
Explanation: pomegranate / hmmlearn comparison
<a href="https://github.com/hmmlearn/hmmlearn">hmmlearn</a> is a Python module for hidden markov models with a scikit-learn li... |
Kaggle/learntools | notebooks/geospatial/raw/ex4.ipynb | apache-2.0 | import math
import pandas as pd
import geopandas as gpd
#from geopy.geocoders import Nominatim # What you'd normally run
from learntools.geospatial.tools import Nominatim # Just for this exercise
import folium
from folium import Marker
from folium.plugins import MarkerCluster
from learntools.core import b... |
MaxPowerWasTaken/MaxPowerWasTaken.github.io | jupyter_notebooks/Pandas_View_vs_Copy.ipynb | gpl-3.0 | import pandas as pd
df = pd.DataFrame({'Number' : [100,200,300,400,500], 'Letter' : ['a','b','c', 'd', 'e']})
df
"""
Explanation: Pandas Data Munging: Avoiding that 'SettingWithCopyWarning'
If you use Python for data analysis, you probably use Pandas for Data Munging. And if you use Pandas, you've probably come across... |
mne-tools/mne-tools.github.io | 0.24/_downloads/775a4c9edcb81275d5a07fdad54343dc/channel_epochs_image.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
Explanation: Visualize channel over epochs as an image
This will p... |
tensorflow/probability | tensorflow_probability/examples/jupyter_notebooks/Fitting_DPMM_Using_pSGLD.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
dm-wyncode/zipped-code | content/posts/meditations/mongodb-geojson/solving-a-ftlpd-data-delivery-problem-before-i-write-code.ipynb | mit | from IPython.display import IFrame
IFrame(
'https://www.sunfrog.com/Geek-Tech/First-solve-the-problem-Then-write-the-code.html',
width=800,
height=350,
)
"""
Explanation: T-shirt inspiration
❝first solve the problem then write the code❞
End of explanation
"""
from IPython.display import IFrame
IFrame(
... |
batfish/pybatfish | jupyter_notebooks/Analyzing the Impact of Failures (and letting loose a Chaos Monkey).ipynb | apache-2.0 | # Import packages
%run startup.py
bf = Session(host="localhost")
# Initialize the example network and snapshot
NETWORK_NAME = "example_network"
BASE_SNAPSHOT_NAME = "base"
SNAPSHOT_PATH = "networks/failure-analysis"
bf.set_network(NETWORK_NAME)
bf.init_snapshot(SNAPSHOT_PATH, name=BASE_SNAPSHOT_NAME, overwrite=True)... |
atlury/deep-opencl | DL0110EN/2.2.2_training_slope_and_bias_v2.ipynb | lgpl-3.0 | # These are the libraries we are going to use in the lab.
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
"""
Explanation: <a href="http://cocl.us/pytorch_link_top">
<img src="https://cocl.us/Pytorch_top" width="750" alt="IBM 10TB Storage" />
</a>
<img src="https://ibm.box.com... |
passalis/sef | tutorials/Defining new methods.ipynb | mit | def sim_target_supervised(target_data, target_labels, sigma, idx, target_params):
cur_labels = target_labels[idx]
N = cur_labels.shape[0]
N_labels = len(np.unique(cur_labels))
Gt, mask = np.zeros((N, N)), np.zeros((N, N))
for i in range(N):
for j in range(N):
if cur_labels[i]... |
h-mayorquin/time_series_basic | presentations/2015-11-11(Analyzing text with Nexa, Part 1).ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import h5py
import IPython
import sys
sys.path.append('../')
from inputs.sensors import Sensor, PerceptualSpace
from inputs.lag_structure import LagStructure
from nexa.nexa import Nexa# First we have to load the signal
"""
Explanation: Analyzi... |
google/data-pills | pills/Google Ads/[DATA_PILL]_[Google_Ads]_Customer_Market_Intelligence_(CMI).ipynb | apache-2.0 | audience1_name = "" #@param {type:"string"}
audience1_file_location = "" #@param {type:"string"}
audience1_size = 0#@param {type:"integer"}
audience2_name = "" #@param {type:"string"}
audience2_file_location = "" #@param {type:"string"}
audience2_size = 0 #@param {type:"integer"}
audience3_name = "" #@param {type:"str... |
MTG/essentia | src/examples/python/tutorial_tonal_chords.ipynb | agpl-3.0 | import essentia.streaming as ess
import essentia
audio_file = '../../../test/audio/recorded/mozart_c_major_30sec.wav'
# Initialize algorithms we will use.
loader = ess.MonoLoader(filename=audio_file)
framecutter = ess.FrameCutter(frameSize=4096, hopSize=2048, silentFrames='noise')
windowing = ess.Windowing(type='blac... |
spulido99/NetworksAnalysis | santiagoangee/Ejercicios 1.2 Weak Ties & Random Networks.ipynb | mit | edges = set([(1,2), (2,3), (2,4), (2,5), (4,5), (4,6), (5,6), (4,7)])
from IPython.core.debugger import Tracer
import collections
import numpy as np
""" Without NetworkX """
edges = set([(1,2), (2,3), (2,4), (2,5), (4,5), (4,6), (5,6), (4,7)])
def edges_to_graph(edges):
edges = list(edges)
graph = {}
... |
keras-team/autokeras | docs/ipynb/text_classification.ipynb | apache-2.0 |
dataset = tf.keras.utils.get_file(
fname="aclImdb.tar.gz",
origin="http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz",
extract=True,
)
# set path to dataset
IMDB_DATADIR = os.path.join(os.path.dirname(dataset), "aclImdb")
classes = ["pos", "neg"]
train_data = load_files(
os.path.join(IMD... |
mne-tools/mne-tools.github.io | 0.24/_downloads/88563c785f9a977b7ce2000e660aeacf/30_annotate_raw.ipynb | bsd-3-clause | import os
from datetime import timedelta
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)
raw.crop(tmax=60)... |
josephmfaulkner/stoqs | stoqs/contrib/notebooks/geospatial_selection_rovctd.ipynb | gpl-3.0 | db = 'stoqs_rovctd_mb'
from django.contrib.gis.geos import fromstr
from django.contrib.gis.measure import D
mars = fromstr('POINT(-122.18681000 36.71137000)')
near_mars = Measurement.objects.using(db).filter(geom__distance_lt=(mars, D(km=.1)))
"""
Explanation: Geospatial Selections and ROVCTD data
Connect to a remot... |
stephank16/enes_graph_use_case | neo4j_esgf_b2find/ENES-B2Find-explore.ipynb | gpl-3.0 | import ckanclient
from pprint import pprint
ckan = ckanclient.CkanClient('http://b2find.eudat.eu/api/3/')
"""
Explanation: Simple notebook to explore EUDAT B2Find harvested metadata for ENES
Background:
* EUDAT B2Find harvested ENES metadata consists of metadata for coarse grained data collections
* These coarse gra... |
ML4DS/ML4all | R_lab2_GP/Pract_regression_student.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.io # To read matlab files
from scipy import spatial
import pylab
pylab.rcParams['fi... |
Vvkmnn/books | AutomateTheBoringStuffWithPython/lesson30.ipynb | gpl-3.0 | '\\'.join(['folder1','folder2','folder3','file.png']) # join all elements using the escaped (literal) '\' string
"""
Explanation: Lesson 30:
Filenames and Absolute/Relative File Paths
To make sure a programs output persists, scripts have to save to files.
Filenames and File Paths
Files are held in Folders.
A Folder ... |
kialio/gsfcpyboot | Day_00/03_Functions/FunctionsSolutions.ipynb | mit | 1+2
print 1+2
"""
Explanation: Fun with Functions!
Reference:
Code academy's Functions unit
Our objective is to learn how to write and use functions.
Functions allow us to abstract a task, write code to perform it, and then use it in various situations.
Example:
A calculator takes two numbers and an operator as input... |
vterron/Taller-Optimizacion-Python-Pyomo | 02_PyomoOverview.ipynb | mit | !cat abstract1.py
"""
Explanation: <img src="static/pybofractal.png" alt="Pybonacci" style="width: 200px;"/>
<img src="static/cacheme_logo.png" alt="CAChemE" style="width: 300px;"/>
1. Pyomo Overview
Note: Adapted from https://github.com/Pyomo/PyomoGettingStarted, by William and Becca Hart
1.1 Mathematical Modeling
... |
transcranial/keras-js | notebooks/layers/pooling/MaxPooling3D.ipynb | mit | data_in_shape = (4, 4, 4, 2)
L = MaxPooling3D(pool_size=(2, 2, 2), strides=None, padding='valid', data_format='channels_last')
layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)
# set weights to random (use seed for reproducibility)
np.random.seed(290)
data_in = 2... |
ankitpandey2708/ml | recommender-system/ml-latest-small/model.ipynb | mit | import pandas as pd
import numpy as np
movies_df = pd.read_csv('movies.csv')
movies_df['movie_id'] = movies_df['movie_id'].apply(pd.to_numeric)
movies_df.head(3)
ratings_df=pd.read_csv('ratings.csv')
ratings_df.head(3)
"""
Explanation: Matrix Factorization via Singular Value Decomposition
Matrix factorization is the... |
stephensekula/smu-honors-physics | mathematics_of_life/mathematics_of_life.ipynb | mit | #The Python Imaging Library (PIL)
from PIL import Image, ImageDraw
# Basic math and color tools
import math, colorsys, numpy
# Mathematical plotting
import matplotlib as mpl
from matplotlib import colors as mplcolors
import matplotlib.pyplot as plt
# Displaying real graphical images (pictures)
from IPython.display i... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_08/Begin/Remote Data.ipynb | bsd-3-clause | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime
from pandas_datareader import data, wb
"""
Explanation: Remote Data
Yahoo
St. Louis Fed (FRED)
Google
documentation: http://pandas.pydata.org/pandas-docs/stable/remote_data.html
Installation Requirement
pandas-d... |
adamwang0705/cross_media_affect_analysis | develop/20171024-daheng-prepare_ibm_tweets_news_data.ipynb | mit | """
Initialization
"""
'''
Standard modules
'''
import os
import pickle
import csv
import time
from pprint import pprint
import json
import pymongo
import multiprocessing
import logging
import collections
'''
Analysis modules
'''
%matplotlib inline
%config InlineBackend.figure_format = 'retina' # render double resolu... |
pushpajnc/models | student_intervention/student_intervention-V1.ipynb | mit | # Import libraries
import numpy as np
import pandas as pd
from time import time
from sklearn.metrics import f1_score
from IPython.display import display
import visuals as vs
from IPython.display import display
import sklearn.learning_curve as curves
import matplotlib.pyplot as pl
rstate = 10
%matplotlib inline
# Read... |
bwbadger/mifid2-rts | rts/RTS2_Worked_Examples.ipynb | bsd-3-clause | # Import the RTS 2 module and the Python date & time tools module
import rts2_annex3
import datetime
# Create a simple Python object to represent a trade.
class SampleTrade(object):
pass
sample_trade = SampleTrade()
sample_trade.asset_class_name = 'Foreign Exchange Derivatives'
sample_trade.sub_asset_class_name= '... |
fggp/ctcsound | cookbook/11-GUI-with-PySimpleGUI.ipynb | lgpl-2.1 | import PySimpleGUI as sg
"""
Explanation: Building Graphical Interfaces for ctcsound with PySimpleGUI
There are many GUI toolkits for Python. An overview can be found here. We will choose PySimpleGui here. For running ctcsound, we will use iCsound.
Basic PySimpleGUI Concepts
Once PySimpleGUI is installed via pip or co... |
maurov/xraysloth | notebooks/larch.ipynb | bsd-3-clause | import numpy as np
from larch.io import read_ascii
feo = read_ascii('./larch_data/feo_xafs.dat', labels = 'energy ctime i0 i1 nothing')
feo.mu = - np.log(feo.i1/feo.i0)
"""
Explanation: Examples of XAFS data analysis with Larch
First read in some data
End of explanation
"""
from larch.xafs import autobk
autobk(feo, ... |
iagapov/ocelot | demos/ipython_tutorials/5_CSR.ipynb | gpl-3.0 | # the output of plotting commands is displayed inline within frontends,
# directly below the code cell that produced it
%matplotlib inline
from time import time
# this python library provides generic shallow (copy) and deep copy (deepcopy) operations
from copy import deepcopy
# import from Ocelot main modules and... |
sisnkemp/deep-learning | language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
KOLANICH/RichConsole | Tutorial.ipynb | unlicense | n=RichStr("I am ", "normal")
"""
Explanation: RichStr consist of pieces of strings and RichStrs
End of explanation
"""
n
"""
Explanation: __repr__esentation of a rich string shows a "flat" representation of a RichStr - a sequence of styles and strings where style applies to everything after it. This is how terminal... |
IS-ENES-Data/submission_forms | test/forms/Create_Submission_Form.ipynb | apache-2.0 | from dkrz_forms import form_widgets
form_widgets.show_status('form-generation')
"""
Explanation: Create your DKRZ data ingest request form
To generate a data submission form for you, please edit the cell below to include your name, email as well as the project your data belogs to
Then please press "Shift" + Enter to e... |
RyanSkraba/beam | examples/notebooks/documentation/transforms/python/elementwise/filter-py.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License")
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
austinjalexander/sandbox | python/py/odsc/theano/Theano Tutorial.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import theano
# By convention, the tensor submodule is loaded as T
import theano.tensor as T
"""
Explanation: Theano Tutorial
Theano is a software package which allows you to write symbolic code and compile it onto different architectures (in parti... |
eecs445-f16/umich-eecs445-f16 | lecture16_pgms_latent_vars_cond_independence/lecture16_pgms_latent_vars_cond_independence.ipynb | mit | from __future__ import division
# scientific
%matplotlib inline
from matplotlib import pyplot as plt;
import numpy as np;
import sklearn as skl;
import sklearn.datasets;
import sklearn.cluster;
# ipython
import IPython;
# python
import os;
#####################################################
# image processing
im... |
unoebauer/public-astro-tools | jupyter/pcygni_tutorial.ipynb | mit | import matplotlib.pyplot as plt
"""
Explanation: Pcygni-Profile Calculator Tool Tutorial
This brief tutorial should give you a basic overview of the main features and capabilities of the Python P-Cygni Line profile calculator, which is based on the Elementary Supernova Model (ES) of Jefferey and Branch 1990.
Installat... |
ES-DOC/esdoc-jupyterhub | notebooks/uhh/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', 'uhh', 'sandbox-3', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: UHH
Source ID: SANDBOX-3
Topic: Aerosol
Sub-Topics: Transport, Emissions, Concent... |
ethen8181/machine-learning | deep_learning/multi_label/nsw.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', '..', 'notebook_format'))
from formats import load_style
load_style(plot_style=False)
os.chdir(path)
# 1. magic for inline plot
# 2. magic to print vers... |
mauriciogtec/PropedeuticoDataScience2017 | Proyectos/Proyecto1.ipynb | mit | import numpy as np
"""
Explanation: Creando una sistema de Algebra Lineal
En esta tarea seran guiados paso a paso en como realizar un sistema de arrays en Python para realizar operaciones de algebra lineal.
Pero antes... (FAQ)
Como se hace en la realidad? En la practica, se usan paqueterias funcionales ya probadas, e... |
sujitpal/polydlot | src/tf-serving/02b-model-serializer.ipynb | apache-2.0 | from tensorflow.python.saved_model import builder as saved_model_builder
from tensorflow.python.saved_model import utils, tag_constants, signature_constants
from tensorflow.python.saved_model.signature_def_utils import build_signature_def, predict_signature_def
from tensorflow.contrib.session_bundle import exporter
im... |
jlawman/jlawman.github.io | content/sklearn/Walkthrough - Implementing the Random Forest Classifier for the First Time.ipynb | mit | #Import dataset
from sklearn.datasets import load_iris
iris = load_iris()
"""
Explanation: Implementing the Random Forest Classifier from sci-kit learn
1. Import dataset
This tutorial uses the iris dataset (https://en.wikipedia.org/wiki/Iris_flower_data_set) which comes preloaded with sklearn.
End of explanation
"""
... |
Naereen/notebooks | Efficient_sampling_from_a_Binomial_distribution.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%load_ext cython
%load_ext watermark
%watermark -a "Lilian Besson (Naereen)" -i -v -p numpy,matplotlib,cython
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Bernoulli-and-binomial-distribution" data-toc-modified-id="Bernoulli-and-binomial... |
liganega/Gongsu-DataSci | notebooks/GongSu18-Pandas-tutorial-04.ipynb | gpl-3.0 | # 라이브러리 임포트하기
import pandas as pd
# 데이터셋 만들기
d = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
# 데이터프레임 만들기
df = pd.DataFrame(d)
df
# 열(column)의 이름 변경하기
df.columns = ['Rev']
df
# 열(column) 추가하기
df['NewCol'] = 5
df
# 새로 만든 열(column) 수정하기
df['NewCol'] = df['NewCol'] + 1
df
# 열(column) 삭제하기
del df['NewCol']
df
# 두 개의 열(column) 추가... |
kaushik94/sympy | examples/notebooks/Bezout_Dixon_resultant.ipynb | bsd-3-clause | b_3, b_2, b_1, b_0 = sym.symbols("b_3, b_2, b_1, b_0")
x = sym.symbols('x')
b = sym.IndexedBase("b")
p = b_2 * x ** 2 + b_1 * x + b_0
q = sym.diff(p, x)
subresultants_qq_zz.bezout(p, q, x)
"""
Explanation: The Bezout matrix is a special square matrix associated with two polynomials, introduced by Sylvester (1853) a... |
klin90/titanic | Engineer.ipynb | mit | import matplotlib.pyplot as plt
import scipy.stats as st
import seaborn as sns
import pandas as pd
import numpy as np
%matplotlib notebook
train = pd.read_csv('train.csv', index_col='PassengerId')
test = pd.read_csv('test.csv', index_col='PassengerId')
tr_len = len(train)
df = train.drop('Survived', axis=1).append(t... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-leakage-dir-ex-all-ph-out-12d.ipynb | mit | ph_sel_name = "None"
data_id = "12d"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:38:45 2017
Duration: 7 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
from fretbursts import *
ini... |
IBMDecisionOptimization/docplex-examples | examples/cp/jupyter/house_building.ipynb | apache-2.0 | import sys
try:
import docplex.cp
except:
if hasattr(sys, 'real_prefix'):
#we are in a virtual env.
!pip install docplex
else:
!pip install --user docplex
"""
Explanation: House Building with worker skills
This tutorial includes everything you need to set up decision optimization en... |
peterdalle/mij | 2 Web scraping and APIs/API and Exercise.ipynb | gpl-3.0 | !pip install omdb
"""
Explanation: Consuming API
Instead of using web scraping, using an API, application programming interface, is the preferred method.
Usually, you need to register in order to use an API. But we will use a freely available API called Open Movie Database API.
1. Install Python library
There already ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.