repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
linglaiyao1314/maths-with-python | 04-basic-plotting.ipynb | mit | from matplotlib import pyplot
%matplotlib inline
"""
Explanation: Plotting
There are many Python plotting libraries depending on your purpose. However, the standard general-purpose library is matplotlib. This is often used through its pyplot interface.
End of explanation
"""
from math import sin, pi
x = []
y = []
f... |
IanHawke/RiemannPython | Lesson_03_Characteristics.ipynb | mit | %matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def df_burgers(q):
"""The derivative of the flux function, here defined for Burger's equation."""
return q
def plot_characteristics(df, ql, qr):
"""Plot the characteristic lines for the initial data of a scalar Ri... |
deepchem/deepchem | examples/tutorials/Putting_Multitask_Learning_to_Work.ipynb | mit | !pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Putting Multitask Learning to Work
This notebook walks through the creation of multitask models on MUV [1]. The goal is to demonstrate how multitask methods can provide improved performance in situations with little or very unbalanced da... |
GoogleCloudPlatform/mlops-on-gcp | immersion/tfx_pipelines/04-metadata/labs/lab-04.ipynb | apache-2.0 | import os
import json
import ml_metadata
import tensorflow_data_validation as tfdv
import tensorflow_model_analysis as tfma
from ml_metadata.metadata_store import metadata_store
from ml_metadata.proto import metadata_store_pb2
from tfx.orchestration import metadata
from tfx.types import standard_artifacts
from ten... |
jaekookang/useful_bits | Speech/Extract_Formant_using_Praat/Extract_Formants.ipynb | mit | import os
import numpy as np
from subprocess import Popen, PIPE
from bisect import bisect_left
"""
Explanation: Extract formant frequencies (F1, F2) using Python
<br>
- tested: Python3.6 on Linux and Mac
- 2017-09-01 jk
References:
https://github.com/mwv/praat_formants_python (modified and adapted for Python3.6)
... |
tiddler/AdversarialMNIST | notebook/Different_models.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Here we try to fool other models using same adversarial images
End of explanation
"""
def b... |
AmberJBlue/aima-python | games.ipynb | mit | from games import (GameState, Game, Fig52Game, TicTacToe, query_player, random_player,
alphabeta_player, play_game, minimax_decision, alphabeta_full_search,
alphabeta_search, Canvas_TicTacToe)
"""
Explanation: Games or Adversarial search
This notebook serves as supporting mater... |
PyPSA/PyPSA | examples/notebooks/biomass-synthetic-fuels-carbon-management.ipynb | mit | import pypsa
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Biomass, synthetic fuels and carbon management
In this example we show how to manage different biomass stocks with different potentials and costs, synthetic fuel production, direct air capture (DAC) and carbon capture and usage/sequestrat... |
MikeDacre/fyrd | docs/local_queue.ipynb | mit | queue.put([jon, 'done', None])
myjobs = update_jobs(myjobs, outqueue)
myjobs
runner.is_alive()
outqueue.empty()
myjobs = update_jobs(myjobs, outqueue)
myjobs
"""
Explanation: Note that job 2 has not executed because it is waiting for job 4, which has not run yet
End of explanation
"""
def job_runner(cores, jobqu... |
ONCdb/ONCdb | notebooks/generate_ONCdb.ipynb | mit | # Initialize a database
onc = astrocat.Catalog()
# Ingest a VizieR catalog by supplying a path, catalog name, and column name of a unique identifier
onc.ingest_data(DIR_PATH+'/raw_data/viz_acs.tsv', 'ACS', 'ONCacs', count=10)
# The raw dataset is stored as an attribute
print(onc.ACS)
# Add another one! (This is a t... |
radu941208/DeepLearning | Intro_to_Neural_Networks/Planar+data+classification+with+one+hidden+layer+v4.ipynb | mit | # Package imports
import numpy as np
import matplotlib.pyplot as plt
from testCases_v2 import *
import sklearn
import sklearn.datasets
import sklearn.linear_model
from planar_utils import plot_decision_boundary, sigmoid, load_planar_dataset, load_extra_datasets
%matplotlib inline
np.random.seed(1) # set a seed so tha... |
sraejones/phys202-2015-work | assignments/assignment03/NumpyEx01.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import antipackage
import github.ellisonbg.misc.vizarray as va
"""
Explanation: Numpy Exercise 1
Imports
End of explanation
"""
va.enable()
def checkerboard(size):
k = np.zeros((size,size))
for i in range(size):
... |
ZuckermanLab/NMpathAnalysis | test/Chignoling_FS_after_clustering.ipynb | gpl-3.0 | import sys
import math
sys.path.append("/Users/suarezalvareze2/Documents/workspace/NMpathAnalysis/nmpath")
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pyemma
import mdtraj as md
from glob import glob
# My modules
from auxfunctions import *
from mfpt import *
fr... |
jbusecke/xarrayutils | docs/plotting.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
%load_ext autoreload
%autoreload 2
fig, axarr = plt.subplots(ncols=2, nrows=2)
# plot the same signal scaled and shifted or both
axarr.flat[0].plot(np.random.rand(10))
axarr.flat[1].plot((np.random.rand(10)*5)-16)
axarr.flat[2].plot((np.random.ran... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-1/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynami... |
Olsthoorn/IHE-python-course-2017 | exercises/Apr04/arraysForEngineers.ipynb | gpl-2.0 | import matplotlib.pyplot as plt
import numpy as np
"""You may have to uncomment one of the two following lines to make in line plots available.
But this is not always necessary, for instance not on the mac.
"""
#%matplotlib inline
#%matplotlib notebook # for intractive plots
"""
Explanation: <figure>
<IMG SRC... |
Lstyle1/Deep_learning_projects | autoencoder/Simple_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
anshbansal/anshbansal.github.io | udacity_data_science_notes/intro_data_analysis/lesson_01/L1_Starter_Code.ipynb | mit | ## As list of rows
# Option 1: Each row is a list
csv = [
['A1', 'A2'],
['B1', 'B2']
]
print csv
# Option 2: Each row is a dictionary
# Better if your csv has a header
csv = [
{'name': 'Aseem', 'age': '25'},
{'name': 'Aseem', 'age': '25'}
]
print csv
"""
Explanation: Lesson 1: Data Analysis Process... |
mdpiper/topoflow-notebooks | Meteorology-SnowDegreeDay-Grid.ipynb | mit | from cmt.components import Meteorology, SnowDegreeDay
met, sno = Meteorology(), SnowDegreeDay()
"""
Explanation: Meteorology-SnowDegreeDay coupling: Grid ptypes
Goal: Try to successfully run a coupled Meteorology-SnowDegreeDay simulation, with Meteorology as the driver, and with Grid inputs for SnowDegreeDay.
Import t... |
seinberg/deep-learning | transfer-learning/Transfer_Learning.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
mzszym/oedes | examples/light-emitting/interfacial-feedback-prb66.ipynb | agpl-3.0 | from oedes.fvm import mesh1d
from oedes import progressbar, testing, init_notebook, models, context
init_notebook()
%matplotlib inline
import matplotlib.pylab as plt
import numpy as np
"""
Explanation: Steady-state simulation of organic light emitting cell
This is an example of steady-state simulation of the light emi... |
GoogleCloudPlatform/ai-platform-samples | notebooks/templates/ai_platform_notebooks_template.ipynb | apache-2.0 | %pip install -U missing_or_updating_package --user
"""
Explanation: <table align="left">
<td>
<a href="https://colab.research.google.com/github/GoogleCloudPlatform/ai-platform-samples/blob/main/notebooks/templates/ai_platform_notebooks_template.ipynb">
<img src="https://cloud.google.com/ml-engine/images/co... |
calebfoss/tensorflow | tensorflow/examples/tutorials/deepdream/deepdream_retrained_v02.ipynb | apache-2.0 | # boilerplate code
from __future__ import print_function
import os
from io import BytesIO
import numpy as np
from functools import partial
import PIL.Image
from IPython.display import clear_output, Image, display, HTML
import tensorflow as tf
"""
Explanation: DeepDreaming with TensorFlow
Loading and displaying the m... |
greg-ashby/deep-learning-nanodegree | first-neural-network/nn.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
dxwils3/machine_learning | titanic/TitanicScikit-Learn.ipynb | mit | from __future__ import print_function
from __future__ import division
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn import preprocessing
from sklearn.cross_validation import train_test_split, cross_val_score
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, RandomTr... |
Shauqi/Machine-Learning-Lab | Naive Bayes/Naive Bayes with scikit Learn.ipynb | mit | import pandas as pd
df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/wdbc.data', header=None)
"""
Explanation: In this Notebook Gaussian Naive Bayes is used on wisconsin cancer dataset to classify if it is Malignant or Benign
In the following pandas is used for showi... |
feststelltaste/software-analytics | notebooks/Visualize Developer Contributions with Stream Graphs.ipynb | gpl-3.0 | PROJECT = "intellij-community"
SOURCE_CODE_FILE_EXTENSION = ".java"
TIME_FREQUENCY = "Q" # how should data be grouped? 'Q' means quarterly
FILENAME_PREFIX = "vis/interactive_streamgraph/"
FILENAME_SUFFIX = "_" + PROJECT + "_" + TIME_FREQUENCY
"""
Explanation: Introduction
In this blog post, I want to show you how you... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-hr/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-hr', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-HR
Topic: Land
Sub-Topics: ... |
liyigerry/msm_test | MSMs.ipynb | apache-2.0 | # load simulation data
import mdtraj as md
trajs = [md.load('bound_trajs/liganded_1.pdb'), md.load('bound_trajs/liganded_2.pdb'),
md.load('bound_trajs/liganded_3.pdb'), md.load('bound_trajs/liganded_4.pdb'),
md.load('bound_trajs/liganded_5.pdb'), md.load('bound_trajs/liganded_6.pdb'),
md.... |
tensorflow/docs-l10n | site/ko/tutorials/distribute/keras.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... |
materials-commons/materials-commons.github.io | materials-commons-cli/html/examples/MaterialsCommons-Project-Example.ipynb | mit | # Login information (Edit here or be prompted by the next cell)
email = None
mcurl = "https://materialscommons.org/api"
# Construct a Materials Commons client
from materials_commons.cli.user_config import make_client_and_login_if_necessary
if email is None:
print("Account (email):")
email = input()
client ... |
blanton144/exex | docs/notebooks/distance-ladder.ipynb | bsd-3-clause | tables = Gaia.load_tables()
"""
Explanation: Distance Ladder Numerical and Data Exercises
2. Distances using RR Lyrae standard candles
Author: Dave Mykytyn
The Clementini et al. 2018 RR Lyrae results are available from the Gaia data set, which we can access through the astroquery Python package.
End of explanation
"""... |
rigetticomputing/grove | examples/GroversAlgorithm.ipynb | apache-2.0 | from itertools import product
from mock import patch
from grove.amplification.grover import Grover
"""
Explanation: This notebook is a brief sketch of how to use Grover's algorithm.
We start by declaring all necessary imports.
End of explanation
"""
target_bitstring = '010'
bit = ("0", "1")
bitstring_map = {}
targ... |
zhuanxuhit/deep-learning | autoencoder/Convolutional_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[2]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
nudomarinero/mltier1 | PanSTARRS_WISE_catalogues.ipynb | gpl-3.0 | import numpy as np
from astropy.table import Table
from wquantiles import median as wmedian
import os
from mltier1 import describe, Field
%pylab inline
"""
Explanation: PanSTARRS - WISE crossmatch: Load and filter catalogues
First step in the maximum likelihood crossmatch between PanSTARRS and WISE.
The software dep... |
tensorflow/docs-l10n | site/ja/tutorials/generative/adversarial_fgsm.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... |
TimothyHelton/k2datascience | notebooks/US_Chronic_Disease_Indicators.ipynb | bsd-3-clause | import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from k2datascience import chronic_disease
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
%matplotlib inline
"""
Explanation: US Chronic Disease Indic... |
fionapigott/Data-Science-45min-Intros | networks-203/centrality-metrics.ipynb | unlicense | # handy graph library for python
import igraph
# science
import numpy as np
from collections import defaultdict
# plot things
import tabulate
import matplotlib.pyplot as plt
%matplotlib inline
# get some toy graph data so we can demonstrate these properties
network = igraph.Nexus.get("kaptail")['KAPFTI1']
network.summ... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Python-for-Data-Visualization/Geographical Plotting/Choropleth Maps Exercise .ipynb | mit | import plotly.graph_objs as go
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode(connected=True)
import pandas as pd
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Choropleth Maps Exercise
Welcome to the Choropleth Maps Exercise! In this exercis... |
dougsweetser/ipq | q_notebooks/triple_products_and_distance.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... |
saashimi/code_guild | wk9/notebooks/Ch.3-Testing a Simple Home Page with Unit Tests.ipynb | mit | %cd ../examples/superlists/
# Make a new app called lists
!python3 manage.py startapp lists
!tree .
"""
Explanation: In the last chapter, our tests failed. This time we'll go about fixing them.
Our First Django App, and Our First Unit Test
Django encourages you to structure your code into apps: the theory is that on... |
Lstyle1/Deep_learning_projects | 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)
#Test
print(source_text[:100])
unique_words = set([word for word in... |
tensorflow/docs-l10n | site/ja/model_optimization/guide/clustering/clustering_comprehensive_guide.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... |
nwjs/chromium.src | third_party/tensorflow-text/src/docs/tutorials/classify_text_with_bert.ipynb | bsd-3-clause | #@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... |
ML4DS/ML4all | P3.Python_datos/Old/Data_python_professor.ipynb | mit | %matplotlib inline
# Needed to include the figures in this notebook, you can remove it
# to work with a normal script
import numpy as np
import csv
import matplotlib.pyplot as plt
from sklearn.neighbors import KNeighborsRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.cross_validation impor... |
mbeyeler/opencv-machine-learning | notebooks/09.05-Training-a-Deep-Neural-Net-to-Classify-Handwritten-Digits-Using-Keras.ipynb | mit | import numpy as np
np.random.seed(1337) # for reproducibility
"""
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: 1px... |
facebookincubator/prophet | notebooks/additional_topics.ipynb | bsd-3-clause | %%R
saveRDS(m, file="model.RDS") # Save model
m <- readRDS(file="model.RDS") # Load model
"""
Explanation: Saving models
It is possible to save fitted Prophet models so that they can be loaded and used later.
In R, this is done with saveRDS and readRDS:
End of explanation
"""
import json
from prophet.serialize imp... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_dfnp/decorrelation_correction.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.data - Décorrélation de variables aléatoires - correction
On construit des variables corrélées gaussiennes et on cherche à construire des variables décorrélées en utilisant le calcul matriciel. (correction)
End of explanation
"""
imp... |
karlstroetmann/Formal-Languages | ANTLR4-Python/Interpreter/Interpreter-Matching.ipynb | gpl-2.0 | !type Pure.g4
!cat -n Pure.g4
"""
Explanation: An Interpreter for a Simple Programming Language
In this notebook we develop an interpreter for a small programming language.
The grammar for this language is stored in the file Pure.g4.
End of explanation
"""
!type sum.sl
!cat sum.sl
"""
Explanation: The grammar sh... |
ES-DOC/esdoc-jupyterhub | notebooks/pcmdi/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: PCMDI
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Propertie... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/exponential_smoothing.ipynb | bsd-3-clause | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt
%matplotlib inline
data = [
446.6565,
454.4733,
455.663,
423.6322,
456.2713,
440.5881,
425.3325,
485.1494,
506.0482,
5... |
darkomen/TFG | medidas/06082015/Untitled.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
schmidtc/pysal | pysal/contrib/handler/Explaining the Handler.ipynb | bsd-3-clause | import handler as h
import pysal as ps
import geopandas as gpd
df = gpd.read_file(ps.examples.get_path('columbus.json'))
dbf = ps.open(ps.examples.get_path('columbus.dbf'))
y = dbf.by_col_array(['HOVAL'])
X = dbf.by_col_array(['INC', 'CRIME'])
W = ps.open(ps.examples.get_path('columbus.gal')).read()
original = ps.spr... |
synthicity/synthpop | demos/.ipynb_checkpoints/census_api-checkpoint.ipynb | bsd-3-clause | c = Census(os.environ["CENSUS"])
"""
Explanation: The census api needs a key - you can register for can sign up
http://api.census.gov/data/key_signup.html
End of explanation
"""
income_columns = ['B19001_0%02dE'%i for i in range(1, 18)]
vehicle_columns = ['B08201_0%02dE'%i for i in range(1, 7)]
workers_columns = ['B... |
aldian/tensorflow | tensorflow/lite/g3doc/tutorials/model_maker_image_classification.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... |
kabrapratik28/Stanford_courses | cs231n/assignment2/BatchNormalization.ipynb | apache-2.0 | # As usual, a bit of setup
from __future__ import print_function
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.solv... |
mgalloy/burin | examples/examples.ipynb | bsd-3-clause | %cat epochs_spec.cfg
%cat epochs.cfg
"""
Explanation: Config files with specifications
Epoch files
Epoch files are config files which specify a set of options repeatedly on different date/times, represented by sections of the config file. When a value for an option for a given date is requested, the value in the last... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_stats_cluster_1samp_test_time_frequency.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import tfr_morlet
from mne.stats import permutation_cluster_1samp_test
from mne.datasets import sample
print(__doc__)
"""
Explanat... |
ES-DOC/esdoc-jupyterhub | notebooks/inpe/cmip6/models/sandbox-3/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: INPE
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_decoding_xdawn_eeg.ipynb | bsd-3-clause | # Authors: Alexandre Barachant <alexandre.barachant@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cross_validation import StratifiedKFold
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import ... |
tensorflow/agents | docs/tutorials/10_checkpointer_policysaver_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... |
diegocavalca/Studies | deep-learnining-specialization/2. improving deep neural networks/resources/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... |
skipamos/code_guild | wk0/notebooks/challenges/reverse_string/reverse_string_challenge.ipynb | mit | def list_of_chars(list_chars):
# TODO: Implement me
pass
"""
Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small>
Challenge Notebook
Problem: Implement a function to reverse a string (a list of characters), in-place.
Constraints
Test Cases
Algori... |
tdamsma/sudoku | 0_Introductie.ipynb | mit | a=2
b=3
a+b
a
"""
Explanation: Introductie
Voorbereiding
Om zelf een jupyter notebook te draaien moet je het volgende doen:
Installeer Anaconda
start de python omgeving vanaf de command line met het commando
jupyter notebook
open de notebook omgeving in je browser: http://localhost:8888
Wat ook kan is een tijde... |
alanhdu/AccessibleML | 3. Timeseries Regression.ipynb | mit | import pandas as pd
import numpy as np
from pandas.tools.plotting import autocorrelation_plot
from matplotlib import pyplot as plt
from statsmodels.tsa.arima_model import ARIMA
from statsmodels.tsa.stattools import adfuller
import statsmodels.api as sm
plt.rcParams['figure.figsize'] = (10, 6)
%matplotlib inline
"""
E... |
jorisvandenbossche/DS-python-data-analysis | _solved/pandas_03b_indexing.ipynb | bsd-3-clause | import pandas as pd
# redefining the example dataframe
data = {'country': ['Belgium', 'France', 'Germany', 'Netherlands', 'United Kingdom'],
'population': [11.3, 64.3, 81.3, 16.9, 64.9],
'area': [30510, 671308, 357050, 41526, 244820],
'capital': ['Brussels', 'Paris', 'Berlin', 'Amsterdam', 'Lo... |
mathemage/h2o-3 | examples/deeplearning/notebooks/deeplearning_mnist_introduction.ipynb | apache-2.0 | import h2o
h2o.init(nthreads=-1)
import os.path
PATH = os.path.expanduser("~/h2o-3/")
test_df = h2o.import_file(PATH + "bigdata/laptop/mnist/test.csv.gz")
train_df = h2o.import_file(PATH + "bigdata/laptop/mnist/train.csv.gz")
"""
Explanation: DeepLearning
Introduction
In this notebook, we introduce H2O Deep Learnin... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/MLP/Part 5 - Inference and Validation (Solution).ipynb | apache-2.0 | import torch
from torchvision import datasets, transforms
# Define a transform to normalize the data
transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
# Download and load the training data
trainset = datasets.FashionMNIST('~/... |
PiercingDan/mat245 | Labs/Lab10/MAT245 Lab 10.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import expit
from sklearn import datasets, mixture
xs = np.linspace(-5, 5)
fig = plt.figure(figsize=(20, 5))
## Plot relu
ax1 = fig.add_subplot(1, 3, 1)
ax1.plot(xs, np.maximum(0, xs))
## Plot sigmoid
ax2 = fig.add_subplot(1, 3, 2)
ax2.plot(xs, e... |
deepmind/acme | examples/tutorial.ipynb | apache-2.0 | #@title Install necessary dependencies.
!sudo apt-get install -y xvfb ffmpeg
!pip install 'gym==0.10.11'
!pip install imageio
!pip install PILLOW
!pip install 'pyglet==1.3.2'
!pip install pyvirtualdisplay
!pip install dm-acme
!pip install dm-acme[reverb]
!pip install dm-acme[tf]
!pip install dm-acme[envs]
from IPyth... |
varun-invent/Autism-Connectome-Analysis | notebooks/roi_check.ipynb | apache-2.0 | import numpy as np
import nibabel as nib
atlas_path = '/home1/varunk/results_again_again/ABIDE1_Preprocess_Datasink/atlas_paths/atlas_file_list.npy'
atlas_files = np.load(atlas_path)
atlas_files[41]
in_file = atlas_files[40]
atlas_values_list = nib.load(in_file).get_data().ravel()
universe = set(np.arange(274))
u... |
davidzchen/tensorflow | tensorflow/lite/g3doc/performance/post_training_float16_quant.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... |
Featuretools/featuretools | docs/source/guides/using_dask_entitysets.ipynb | bsd-3-clause | import featuretools as ft
import pandas as pd
import dask.dataframe as dd
id = [0, 1, 2, 3, 4]
values = [12, -35, 14, 103, -51]
df = pd.DataFrame({"id": id, "values": values})
dask_df = dd.from_pandas(df, npartitions=2)
dask_df
"""
Explanation: Using Dask EntitySets (BETA)
Creating a feature matrix from a very large... |
aslihandincer/coursera-machinelearning-python | ex2/ml-ex2.ipynb | mit | import pandas
import numpy as np
import scipy.optimize
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Exercise 2: Logistic Regression
End of explanation
"""
data1 = pandas.read_csv("ex2data1.txt", header=None, names=['test1', 'test2', 'accepted'])
data1.head()
"""
Explanation: Part 1: Plotting
... |
gear/HPSC | lec_samples/lec2_navier_stokes.ipynb | gpl-3.0 | import numpy as np
from matplotlib import pyplot
# Iterative for 1-D linear convection
def lin_convection_1d(nx=41, nt=100, dt=0.01, c=1, u_init = [2,2,2,2], init_offset = 5) :
'''
nx = 41 # Number of horizontal location points (x axis on graph)
nt = 100 # Number of time step (iteration)
dt = .01 # Res... |
navoj/ecell4 | ipynb/Tutorials/WorldSimBasics.ipynb | gpl-2.0 | %matplotlib inline
import numpy
from ecell4 import *
with reaction_rules():
A + B == C | (0.01, 0.3)
y = run_simulation(numpy.linspace(0, 10, 100), {'C': 60}, volume=1.0)
"""
Explanation: World and Simulator with ODE solver
If you read through Model basics, it is NOT difficult to use World and Simulator.
volume... |
jayme-anchante/cv-bio | courses/python_for_data_analysis/week5_data_visualization.ipynb | mit | import pandas as pd
import numpy as np
import random
import matplotlib.pyplot as plt
data = pd.read_csv('./Indicators.csv.zip')
data.shape
data.head(10)
# How many unique country names are there?
countries = data['CountryName'].unique().tolist()
len(countries)
# Are there same number of country codes?
countryCode... |
solowPy/solowPy | examples/1 Getting started.ipynb | mit | import numpy as np
import sympy as sym
import solowpy
"""
Explanation: <div align='center' ><img src='https://raw.githubusercontent.com/davidrpugh/numerical-methods/master/images/sgpe-logo.jpg' width="1200" height="100"></div>
<div align='right'><img src='https://raw.githubusercontent.com/davidrpugh/numerical-methods/... |
PyladiesMx/Empezando-con-Python | Python_and_physics/Lorena_codigo.ipynb | mit | %matplotlib inline
"""
Explanation: Ejemplo práctico de uso de diccionarios y for loops ( y gráficas).
Comportamiento de neuronas.
Utilizando un modelo matemático (modelo de electrodifusión).
El modelo describe la actividad eléctrica de una neurona, al variar los distintos parámetros. <br />
Yo tengo un sistema de dos... |
skumagai/skumagai.github.io | format-to-json.ipynb | mit | metadata = pd.read_csv('game-metadata.csv', dtype={'gameid': np.int64})
"""
Explanation: Preparing data for Sankey and Radial-Game-Tree
Reading two data files
End of explanation
"""
metadata.head()
moves = pd.read_csv('game-moves.csv') #, dtype={'moveid': np.int32, 'xnorm': np.int32, 'ynorm': np.int32})
moves = mov... |
PrairieLearn/PrairieLearn | exampleCourse/questions/demo/annotated/LectureVelocity/2-Derivative/workspace/Workbook.ipynb | agpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Graphical interpretation for derivatives
Instructions: To run/evaluate cells in this notebook, you should click on a given cell, and then either 1) use Ctrl-Enter or 2) click the button "Run" in the menu bar above.
Initialize some o... |
AhmetHamzaEmra/Deep-Learning-Specialization-Coursera | Improving Deep Neural Networks/Optimization+methods.ipynb | mit | 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... |
quantopian/research_public | notebooks/data/eventvestor.index_changes/notebook.ipynb | apache-2.0 | # import the dataset
from quantopian.interactive.data.eventvestor import index_changes
# or if you want to import the free dataset, use:
# from quantopian.interactive.data.eventvestor import index_changes_free
# import data operations
from odo import odo
# import other libraries we will use
import pandas as pd
# Let'... |
mne-tools/mne-tools.github.io | 0.23/_downloads/ed3aac2f41b33de8577252a462d2798c/mne_inverse_envelope_correlation_volume.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# Sheraz Khan <sheraz@khansheraz.com>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import mne
from mne.beamformer import make_lcmv, apply_lcmv_epochs
from mne.connectivity import envelope_correlation
fro... |
hhain/sdap17 | notebooks/henrik_ueb01/02_Classification.ipynb | mit | # Load neccessary libraries changed pandas import for convinience
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.datasets import make_classification
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import train... |
AllenDowney/ModSim | python/soln/chap11.ipynb | gpl-2.0 | # install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download modsim.py if necessary
from os.path import exists
filename = 'modsim.py'
if not exists(filename):
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/'
... |
wangbeiqi199159/data-512-a1 | scr/hcds-a1-data-curation.ipynb | mit | import urllib.request
import json
import datetime
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from pandas.io.json import json_normalize
"""
Explanation: HW1 Data curation
The goal of this assignment is to construct, analyze, and publish a dataset of monthly... |
feststelltaste/software-analytics | cheatbooks/pandas_basics.ipynb | gpl-3.0 | import pandas as pd
"""
Explanation: Pandas basics
This Cheatbook guides you through basic operations and mechanics of pandas.
References
Pandas' website
Pandas' user guide
First, we import pandas as pd for short. This allows us to use pandas under the abbreviation pd, which saves use some keystrokes.
End of explana... |
bambinos/bambi | docs/notebooks/negative_binomial.ipynb | mit | import arviz as az
import bambi as bmb
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.stats import nbinom
az.style.use("arviz-darkgrid")
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
"""
Explanation: Negative Binomial Regression (Students absence e... |
cliburn/sta-663-2017 | homework/05_Making_Python_Faster_Solutions.ipynb | mit | def logistic(x):
"""Logistic function."""
return np.exp(x)/(1 + np.exp(x))
def gd(X, y, beta, alpha, niter):
"""Gradient descent algorihtm."""
n, p = X.shape
Xt = X.T
for i in range(niter):
y_pred = logistic(X @ beta)
epsilon = y - y_pred
grad = Xt @ epsilon / n
... |
WMD-group/SMACT | examples/Solar_oxides/SolarOxides.ipynb | mit | ### Imports ###
import smact
from smact import screening
from itertools import combinations, product
import multiprocessing
from pymatgen import Composition
import pandas as pd
from matminer.featurizers.conversions import StrToComposition
from matminer.featurizers.base import MultipleFeaturizer
from matminer.featurizer... |
Jim00000/Numerical-Analysis | 1_Solving_Equations.ipynb | unlicense | # Import modules
import traceback
import numpy as np
import scipy
import scipy.linalg as LA
import matplotlib.pyplot as plt
import sympy
import sympy.abc
from scipy import optimize
from IPython.display import display
# Initialize sympy
sympy.init_printing(use_unicode=True)
def bisect(f, a, b, tol):
"""
Compu... |
amanikamail/flexx | examples/notebooks/flexx_tutorial_ui.ipynb | bsd-2-clause | from flexx import app, ui, react
app.init_notebook()
"""
Explanation: Tutorial for flexx.ui - creating widgets and user interfaces
End of explanation
"""
b = ui.Button(text='foo')
b
"""
Explanation: Displaying widgets
Widgets can be inserted into the notebook by making them a cell output:
End of explanation
"""
b... |
ecell/ecell4-notebooks | docs/tutorials/tutorial10.ipynb | gpl-2.0 | %matplotlib inline
from ecell4.prelude import *
"""
Explanation: 10. Spatiocyte Simulations at Single-Molecule Resolution
We showed an example of E-Cell4 spatial representation.
Next let's simulate the models with more detailed spatial representation called "single molecule resolution".
End of explanation
"""
with s... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/time_series_prediction/solutions/optional_1_data_exploration.ipynb | apache-2.0 | PROJECT = 'qwiklabs-gcp-ml-489e10787faf' # Change to your project.
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from google.cloud import bigquery
from IPython.core.magic import register_cell_magic
from IPython import get_ipython
bq = bigquery.Client(project=PROJE... |
ImAlexisSaez/deep-learning-specialization-coursera | course_1/week_3/assignment_1/planar_data_classification_with_one_hidden_layer_v2.ipynb | mit | # Package imports
import numpy as np
import matplotlib.pyplot as plt
from testCases import *
import sklearn
import sklearn.datasets
import sklearn.linear_model
from planar_utils import plot_decision_boundary, sigmoid, load_planar_dataset, load_extra_datasets
%matplotlib inline
np.random.seed(1) # set a seed so that t... |
strikingmoose/chi_lars_face_detection | notebook/3 - TFlearn & MNIST.ipynb | apache-2.0 | # TFlearn libraries
import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression
import tflearn.datasets.mnist as mnist
# General purpose libraries
import matplotlib.pyplot as plt
import numpy as... |
DawesLab/Instruments | Rigol Arb Gen Waveform Creation.ipynb | gpl-3.0 | import numpy
import matplotlib.pyplot as plt
import usbtmc
%matplotlib inline
# this connects to the instrument directly using it's USB ID:
handle = usbtmc.Instrument(int("1AB1",16),int("0641",16))
# This will probably timeout the first time. Just run it again
handle.ask('*IDN?')
# set voltage high
handle.write(":VO... |
mari-linhares/tensorflow-workshop | code_samples/RNN/sentiment_analysis/.ipynb_checkpoints/SentimentAnalysis-batch_64-checkpoint.ipynb | apache-2.0 | # Tensorflow
import tensorflow as tf
print('Tested with TensorFLow 1.2.0')
print('Your TensorFlow version:', tf.__version__)
# Feeding function for enqueue data
from tensorflow.python.estimator.inputs.queues import feeding_functions as ff
# Rnn common functions
from tensorflow.contrib.learn.python.learn.estimators i... |
NagyAttila/Udacity_DLND_Assigments | 4_dlnd_language_translation/dlnd_language_translation.ipynb | gpl-3.0 | """
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.