repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
AleksanderLidtke/AnalyseCollisionFragments | ResultingToGeneratedFragmentsRatio.ipynb | mit | import matplotlib.pyplot
assert matplotlib.__version__>='1.5.1'
import numpy
assert numpy.__version__>='1.10.4'
"""
Explanation: Module imports and version check
Import the key modules needed later on and check their versions to make sure this analysis can be reproduced.
End of explanation
"""
# Show the plots insi... |
Chiroptera/QCThesis | notebooks/Horn accuracy.ipynb | mit | %pylab inline
#%qtconsole
import seaborn as sns
import sklearn
from sklearn import preprocessing,decomposition,datasets
%cd /home/chiroptera/workspace/QCThesis/
import haddock.cluster.Horn as HornAlg
reload(HornAlg)
%cd /home/chiroptera/workspace/QCThesis/cluster\ consistency
import determine_ci
reload(determine_ci)... |
tensorflow/docs | site/en/r1/tutorials/keras/overfit_and_underfit.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... |
NYUDataBootcamp/Projects | MBA_S17/Gitan-Syrian-Refugee-Resettlement.ipynb | mit | import plotly
plotly.tools.set_credentials_file(username='ionutgitan', api_key='d0QXm30QhDEcnGMQcE5c')
import plotly.plotly as py
import pandas as pd
df = pd.read_csv('https://ionutgitan.com/s/Gitan_Data.csv')
df.head()
df['text'] = df['name'] + '<br>Syrian Refugees ' + (df['pop']).astype(str)
limits = [(0,5),(6,15... |
ledeprogram/algorithms | class6/donow/najmabadi_shannon_6_donow.ipynb | gpl-3.0 | import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
%matplotlib inline
import statsmodels.formula.api as smf
"""
Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regression model
End of explanation
"""
df = pd.read_csv('hanford.csv')
"""
E... |
ekansa/open-context-jupyter | notebooks/EOL to GBIF.ipynb | mit | import json
import os
import requests
from time import sleep
import numpy as np
import pandas as pd
# Get the root_path for this jupyter notebook repo.
repo_path = os.path.dirname(os.path.abspath(os.getcwd()))
# Path for the (gzip compressed) CSV data dump from EOL
# with GBIF names and EOL IDs.
eol_gbif_names_path... |
mne-tools/mne-tools.github.io | stable/_downloads/99a2efbcf51159fbb58f12830f81525d/compute_csd.ipynb | bsd-3-clause | # Author: Marijn van Vliet <w.m.vanvliet@gmail.com>
# License: BSD-3-Clause
from matplotlib import pyplot as plt
import mne
from mne.datasets import sample
from mne.time_frequency import csd_fourier, csd_multitaper, csd_morlet
print(__doc__)
"""
Explanation: Compute a cross-spectral density (CSD) matrix
A cross-spe... |
aidiary/notebooks | keras/170615-keras-dcgan.ipynb | mit | %matplotlib inline
from keras.models import Sequential
from keras.layers import Dense, Reshape
from keras.layers.core import Activation, Flatten
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutional import UpSampling2D, Conv2D, MaxPooling2D
from keras.optimizers import SGD
from kera... |
UIUC-iSchool-DataViz/fall2017 | week06/prep_notebook_week06_02.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import csv
import numpy as np
plt.rcParams["figure.figsize"] = (12, 10)
plt.style.use("seaborn")
"""
Explanation: Color Fundamentals
This notebook describes a few fundamental aspects of how we perceive colors, and then proceeds to quantify a couple different colormap... |
DJCordhose/ai | notebooks/md/4-tf-keras-tensorflow-nn.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import pandas as pd
print(pd.__version__)
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.__version__)
"""
Explanation: Neural Networks with TensorFlow and Keras
End of explanation
"""
df = pd.read_csv('... |
Vooban/Decision-Trees-For-Knowledge-Discovery | Decision-Trees-For-Knowledge-Discovery-With-XGBoost.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import xgboost as xgb
from xgboost import plot_tree
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
import os
"""
Explanation: Discovering structure behind data
Let's understand and model the hidden structure behind data with Decisio... |
grantjenks/pyannote-core | notebook/pyannote.core.timeline.ipynb | mit | from pyannote.core import Timeline
"""
Explanation: Timeline (pyannote.core.timeline.Timeline)
End of explanation
"""
timeline = Timeline(uri='MyAudioFile')
"""
Explanation: Timeline instances are used to describe sets of temporal fragments (e.g. of an audio file).
One can optionally store an identifier of the asso... |
mne-tools/mne-tools.github.io | 0.24/_downloads/bdc99305dd93336f2d973c05e0c46d24/25_automated_coreg.ipynb | bsd-3-clause | # Author: Jon Houck <jon.houck@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
import mne
from mne.coreg import Coregistration
from mne.io import read_info
data_path = mne.datasets.sample.data_path()
subjects_dir = op.join(data... |
ioos/system-test | content/downloads/notebooks/2015-10-26-HF_Radar_Currents_west_coast.ipynb | unlicense | from datetime import datetime, timedelta
bounding_box_type = "box"
bounding_box = [-123, 36, -121, 40]
# Temporal range.
now = datetime.utcnow()
start, stop = now - timedelta(days=(7)), now
# URL construction.
iso_start = start.strftime('%Y-%m-%dT%H:%M:00Z')
iso_end = stop.strftime('%Y-%m-%dT%H:%M:00Z')
print('{}... |
ogaway/Matching-Market | Comparison.ipynb | gpl-3.0 | %matplotlib inline
import matchfuncs as mf
prop_num = 5
resp_num = 3
prop_prefs = [
[2, 0, 1],
[2, 1, 0],
[1, 2, 0],
[1, 2, 0],
[1, 2, 0]
]
resp_prefs = [
[4, 3, 1, 2, 0],
[1, 0, 4, 3, 2],
[1, 3, 0, 2, 4]
]
prop_caps = [1, 3, 2, 2, 1]
resp_caps = [2, 2, 4]
list_length = 3
"""
Explanati... |
shogun-toolbox/shogun | doc/ipython-notebooks/intro/Introduction.ipynb | bsd-3-clause | import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
import shogun as sg
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Machine Learning with Shogun
By Saurabh Mahindre - <a href="https://github.com/Saurabh7">github.com/Saurabh7</a> as a part... |
eggie5/UCSD-MAS-DSE230 | hmwk5/1.CoverType.ipynb | mit | #define a dictionary of cover types
CoverTypes={1.0: 'Spruce/Fir',
2.0: 'Lodgepole Pine',
3.0: 'Ponderosa Pine',
4.0: 'Cottonwood/Willow',
5.0: 'Aspen',
6.0: 'Douglas-fir',
7.0: 'Krummholz' }
print 'Tree Cover Types:'
CoverTypes
# creating a direc... |
MBARIMike/stoqs | stoqs/contrib/notebooks/geospatial_sample_selection_may2018.ipynb | gpl-3.0 | db = 'stoqs_canon_may2018'
from django.contrib.gis.geos import fromstr
from django.contrib.gis.measure import D
ts_loc = fromstr('POINT(-122.520 36.980)')
near_ts_loc = Measurement.objects.using(db).filter(geom__distance_lt=(ts_loc, D(km=1.0)))
acts = Activity.objects.using(db).filter(instantpoint__measurement__in=n... |
piscataway/datascience | lab/04 Regularization-v1.ipynb | mit | # Agenda
"""
Explanation: Piscataway Data Science
Dec-07 2017
<img src="../img/pds.png" align="left" alt="pds">
<font color="blue">
Prasanna Joshi
Big Data Architect<br>
https://www.linkedin.com/in/prasannajoshi
<font color="blue">
Meetup<br><font color=black>email:</font> gotokermit@gmail.com<br><font color=black>cod... |
arnaldog12/Manual-Pratico-Deep-Learning | Funções de Ativação.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as wg
from ipywidgets import interactive, fixed
%matplotlib inline
def plot_interactive(w, b, func, ylim=fixed((0, 1)), show_der=False):
plt.figure(0)
x = np.linspace(-10, 10, num=1000)
z = w*x + b
y = func(z)
plt.plot(... |
tpin3694/tpin3694.github.io | machine-learning/binarize_image.ipynb | mit | # Load image
import cv2
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: Title: Binarize Images
Slug: binarize_image
Summary: How to binarize images using OpenCV in Python.
Date: 2017-09-11 12:00
Category: Machine Learning
Tags: Preprocessing Images
Authors: Chris Albon
Preliminaries
End o... |
hvillanua/deep-learning | autoencoder/Convolutional_Autoencoder_Solution.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... |
FiryZeplin/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... |
dtamayo/rebound | ipython_examples/OrbitalElements.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1., x=1., vz = 2.)
"""
Explanation: Orbital Elements
Note: All angles for orbital elements are in radians
We can add particles to a simulation by specifying cartesian components:
End of explanation
"""
sim.add(m=1., a=1.)
sim.status()
"""
Explanation: Any compone... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/.ipynb_checkpoints/Timing your code - timeit-checkpoint.ipynb | apache-2.0 | import timeit
"""
Explanation: Timing your code
Sometimes its important to know how long your code is taking to run, or at least know if a particular line of code is slowing down your entire project. Python has a built-in timing module to do this.
This module provides a simple way to time small bits of Python code. I... |
mne-tools/mne-tools.github.io | 0.19/_downloads/43b08af05181aa9ee6947cbe626ed9cc/plot_object_evoked.ipynb | bsd-3-clause | import os.path as op
import matplotlib.pyplot as plt
import mne
"""
Explanation: The :class:Evoked <mne.Evoked> data structure: evoked/averaged data
The :class:Evoked <mne.Evoked> data structure is mainly used for storing
averaged data over trials. In MNE the evoked objects are usually created by
averagin... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_eco2/td2a_eco_5d_Travailler_du_texte_les_expressions_regulieres.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.eco - Les expressions régulières : à quoi ça sert ?
Chercher un mot dans un texte est une tâche facile, c'est l'objectif de la méthode find attachée aux chaînes de caractères, elle suffit encore lorsqu'on cherche un mot au pluriel ou a... |
WeirdCircumstances/hu_bp_python_course | 02_introduction/intro_to_python.ipynb | mit | print "Hello, world!"
print("Hello, world!")
"""
Explanation: Introduction to Python
Why Python?
easy to learn and use
excellent for beginners, yet superb for experts
highly scalable, suitable for large projects as well as small ones
rapid development
portable, cross-platform
powerful standard libs
wealth of 3rd par... |
davidrpugh/pyCollocation | examples/ramsey-cass-koopmans-model.ipynb | mit | def hara(t, c, a, b, **params):
"""
Hyperbolic Absolute Risk Aversion (HARA).
Notes
-----
For Constant Absolute Risk Aversion (CARA), set a=0; for
Constant Relative Risk Aversion (CRRA), set b=0.
"""
return 1 / (a * c + b)
def cobb_douglas_output(k_tilde, alpha, l, **params):
... |
rocketproplab/Guides | Guides/stacksGuides/Stacks_Getting_Started.ipynb | mit | !pip3 install --user git+https://bitbucket.org/subinitial/subinitial.git
"""
Explanation: Stacks Getting Started
Welcome to the Subinitial Stacks Getting Started Guide!
This document will guide you through setup of the Stacks and your first script.
Useful Links
Official Hardware Getting Started Guide
Official Software... |
keras-team/keras-io | examples/rl/ipynb/ddpg_pendulum.ipynb | apache-2.0 | import gym
import tensorflow as tf
from tensorflow.keras import layers
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Deep Deterministic Policy Gradient (DDPG)
Author: amifunny<br>
Date created: 2020/06/04<br>
Last modified: 2020/09/21<br>
Description: Implementing DDPG algorithm on the Inverted P... |
sujitpal/polydlot | src/tf-serving/03a-consume-model.ipynb | apache-2.0 | from __future__ import division, print_function
from grpc.beta import implementations
from sklearn.preprocessing import OneHotEncoder
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service_pb2
import os
import sys
import time
import numpy as np
import tensorflow as tf
# ... |
thalesians/tsa | src/jupyter/python/foundations/probability-theory.ipynb | apache-2.0 | # Copyright (c) Thalesians Ltd, 2017-2019. All rights reserved
# Copyright (c) Paul Alexander Bilokon, 2017-2019. All rights reserved
# Author: Paul Alexander Bilokon <paul@thalesians.com>
# Version: 1.0 (2019.08.03)
# Email: education@thalesians.com
# Platform: Tested on Windows 10 with Python 3.6
"""
Explanation:
E... |
anandha2017/udacity | nd101 Deep Learning Nanodegree Foundation/DockerImages/09_preparing_for_sirajs_lesson/notebooks/02_intro-to-tflearn/TFLearn_Digit_Recognition.ipynb | mit | # Import Numpy, TensorFlow, TFLearn, and MNIST data
import numpy as np
import tensorflow as tf
import tflearn
import tflearn.datasets.mnist as mnist
"""
Explanation: Handwritten Number Recognition with TFLearn and MNIST
In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9.
This... |
robertoalotufo/ia898 | src/cos.ipynb | mit | import numpy as np
def cos(s, t, theta, phi):
r, c = np.indices(s)
tc = t / np.cos(theta)
tr = t / np.sin(theta)
f = np.cos(2*np.pi*(r/tr + c/tc) + phi)
return f
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Function-cos" data-toc-modified-id="Function-cos-1"><span cla... |
gcgruen/homework | foundations-homework/14/14-TF-IDF-Homework-gruen.ipynb | mit | # If you'd like to download it through the command line...
!curl -O http://www.cs.cornell.edu/home/llee/data/convote/convote_v1.1.tar.gz
# And then extract it through the command line...
!tar -zxf convote_v1.1.tar.gz
"""
Explanation: Homework 14 (or so): TF-IDF text analysis and clustering
Hooray, we kind of figured ... |
telescopeuser/workshop_blog | wechat_tool/lesson_3.ipynb | mit | parm_runtime_env_GCP = True
# parm_runtime_env_GCP = False
"""
Explanation: 如何使用和开发微信聊天机器人的系列教程
A workshop to develop & use an intelligent and interactive chat-bot in WeChat
WeChat is a popular social media app, which has more than 800 million monthly active users.
<img src='http://www.kudosdata.com/wp-content/uploads... |
cuttlefishh/papers | vibrio-fischeri-transcriptomics/code/ipynb/vibrio_export_count_tables.ipynb | mit | import pandas as pd
"""
Explanation: Exporting gene count tables for GEO
Format of processed files for my MED4/P-HM2 data:
Tabular format of processed .txt files contains the following fields: 1. Sequential gene number, 2. GenBank identifier, 3. Strand, 4. Start position, 5. End position, 6. Description, 7. Total coun... |
WMD-group/SMACT | examples/Structure_Prediction/Li-Garnets_SP-Pym-new.ipynb | mit | comps=pd.read_csv("Li-Garnet_Comps_sus.csv")
comps.head()
"""
Explanation: Structure Prediction
In this notebook, we aim to do a test of the structure substitution algorithm implemented in SMACT
Before we can do predictions, we need to create our cation mutator, database and a table, and a list of hypothetical composi... |
adriantorrie/adriantorrie.github.io | downloads/notebooks/eoddata/eoddata_web_service_calls_country_list.ipynb | mit | %run ../../code/version_check.py
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Summary" data-toc-modified-id="Summary-1"><span class="toc-item-num">1 </span>Summary</a></div><div class="lev1 toc-item"><a href="#Version-Control" data-toc-modified-id="Version-Control-2"><span clas... |
LuckyGeck/UniverMag-lab3-cache | Report.ipynb | mit | %matplotlib inline
from matplotlib import pyplot
def prepare_stats(path='compact_report_stats.txt'):
graph = dict()
curStats = list()
for line in open(path):
k,v = map(str.strip, line.strip().split('='))
if k == 'n':
curStats = dict()
graph.setdefault(int(v), list())... |
mne-tools/mne-tools.github.io | 0.23/_downloads/2d3a2ce4cdcb2dad9804801c80816516/parcellation.ipynb | bsd-3-clause | # Author: Eric Larson <larson.eric.d@gmail.com>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
Brain = mne.viz.get_brain_class()
subjects_dir = mne.datasets.sample.data_path() + '/subjects'
mne.datasets.fetch_hcp_mmp_parcellation(subjects_dir=subjects_dir,
... |
milani/cycleindex | examples/gama-network.ipynb | bsd-3-clause | import time
import numpy as np
from cycleindex.sampling import nrsampling, vxsampling
from cycleindex import clean_matrix, cycle_count, balance_ratio
"""
Explanation: Gahuku-Gama
In this tutorial, we learn how to use cycleindex package to calculate balance ratios $R_l$ for Gahuku-Gama network which is a signed network... |
vicente-gonzalez-ruiz/YAPT | 02-basics/containers/01-tuples.ipynb | cc0-1.0 | print(type(()))
help(())
"""
Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Containers" data-toc-modified-id="Containers-1"><span class="toc-item-num">1 </span>Containers</a></span><ul class="toc-item"><li><span><a href="#1.-Tu... |
srodriguex/coursera_data_management_and_visualization | Week_3.ipynb | mit | %pylab inline
# This package is very useful to data analysis in Python.
import pandas as pd
# Read the csv file to a dataframe object.
df = pd.read_csv('data/gapminder.csv')
# Convert all number values to float.
df = df.convert_objects(convert_numeric=True)
# Define the Country as the unique id of the dataframe.
df... |
opesci/devito | examples/seismic/self_adjoint/sa_03_iso_correctness.ipynb | mit | from scipy.special import hankel2
import numpy as np
from examples.seismic import RickerSource, Receiver, TimeAxis, Model, AcquisitionGeometry
from devito import (Grid, Function, TimeFunction, SpaceDimension, Constant,
Eq, Operator, solve, configuration, norm)
from devito.finite_differences import ... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_ssp_projs_sensitivity_map.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
from mne import read_forward_solution, read_proj, sensitivity_map
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects'
... |
ltiao/notebooks | exploring-the-google-quickdraw-dataset-with-sketchrnn-part-2.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'svg'
%load_ext autoreload
%autoreload 2
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import tensorflow as tf
from matplotlib.animation import FuncAnimation
from matplotlib.path import Path
from matplotlib import rc
... |
tpin3694/tpin3694.github.io | machine-learning/k-nearest_neighbors_classifer.ipynb | mit | import pandas as pd
from sklearn import neighbors
import numpy as np
%matplotlib inline
import seaborn
"""
Explanation: Title: K-Nearest Neighbors Classification
Slug: k-nearest_neighbors_using_scikit_pandas
Summary: A quick guide to using k-nearest neighbor using numpy and scikit.
Date: 2016-08-31 12:00
Category: M... |
mjames-upc/python-awips | examples/notebooks/METAR_Station_Plot_with_MetPy.ipynb | bsd-3-clause | from awips.dataaccess import DataAccessLayer
from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange
from datetime import datetime, timedelta
import numpy as np
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import pandas as pd
from metpy.calc import w... |
caganze/splat | tutorials/basic_spectral_analysis.ipynb | mit | # main splat import
import splat
import splat.plot as splot
import splat.photometry as sphot
import splat.empirical as spem
# other useful imports
import matplotlib.pyplot as plt
import numpy as np
import pandas
import astropy.units as u
from astropy.io import fits
from astropy.utils.data import download_file
# chec... |
axm108/Rydberg_helium_Stark | notebooks/Transition dipole moments - parallel fields.ipynb | bsd-3-clause | # Calculate everything needed to plot the Stark map. Use Eigenvectors to compute state-mixing weights
# quantum numbers
nmin = 4
nmax = 6
S = 1
field_orientation = 'parallel'
m_vals = np.array([0,1,-1,2,-2,3,-3,4,-4])
n_vals, L_vals, J_vals, neff, En, H_0, mat_S = [], [], [], [], [], [], []
for m_val in m_vals:
n_... |
Code-Girls/2016Summer | Day6/code/intro_to_notebook.ipynb | mit | # this is a code cell
"""
Explanation: The notebook consists of a series of cells. For example, this text is in what is called a "Markdown cell". The following cell is a "code cell":
End of explanation
"""
print("Printing cumulative sum from 1-10:")
total = 0
for i in range(1, 11):
total += i
print("Sum of 1... |
keras-team/keras-io | examples/rl/ipynb/ppo_cartpole.ipynb | apache-2.0 | import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import gym
import scipy.signal
import time
"""
Explanation: Proximal Policy Optimization
Author: Ilias Chrysovergis<br>
Date created: 2021/06/24<br>
Last modified: 2021/06/24<br>
Description: Implementation of a... |
ForestClaw/forestclaw | applications/geoclaw/chile2010/chile2010.ipynb | bsd-2-clause | %run make_topo.py
%run make_data.py
"""
Explanation: Chile 2010
Simulation of the 2010 tsunami off of the coast of Chile.
Create topo file and data files
End of explanation
"""
!chile2010
"""
Explanation: Run code in serial mode (will work, even if code is compiled with MPI)
End of explanation
"""
#!mpirun ... |
tkurfurst/deep-learning | autoencoder/Convolutional_Autoencoder_Solution.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... |
ClementPhil/deep-learning | gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
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')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
anipchile/conicyt | conicyt/Analisis Conicyt.ipynb | bsd-2-clause | conicyt = pd.read_csv('data/tabular/conicyt doctorado nacional 2003-2017.csv')
conicyt.head()
conicyt=conicyt.rename(columns = {'año':'Año', 'n_concursados':'Concursados', 'n_aprobados':'Aprobados'})
conicyt['Tasa de aprobación']=np.round(conicyt['Aprobados']/conicyt['Concursados']*100,decimals=1)
conicyt_postdoc=coni... |
jorisvandenbossche/2015-EuroScipy-pandas-tutorial | 04 - Groupby operations.ipynb | bsd-2-clause | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
try:
import seaborn
except ImportError:
pass
pd.options.display.max_rows = 10
"""
Explanation: Groupby operations
Some imports:
End of explanation
"""
df = pd.DataFrame({'key':['A','B','C','A','B','C','A','B','C'],
... |
TeamHG-Memex/eli5 | notebooks/xgboost-titanic.ipynb | mit | import csv
import numpy as np
with open('titanic-train.csv', 'rt') as f:
data = list(csv.DictReader(f))
data[:1]
"""
Explanation: Explaining XGBoost predictions on the Titanic dataset
This tutorial will show you how to analyze predictions of an XGBoost classifier (regression for XGBoost and most scikit-learn tree... |
raschuetz/foundations-homework | Data_and_Databases_homework/05/homework_5_schuetz.ipynb | mit | from bs4 import BeautifulSoup
from urllib.request import urlopen
html = urlopen("http://static.decontextualize.com/cats.html").read()
document = BeautifulSoup(html, "html.parser")
"""
Explanation: Homework #5
This homework presents a sophisticated scenario in which you must design a SQL schema, insert data into it, an... |
GoogleCloudPlatform/mlops-on-gcp | workshops/tfx-caip-tf23/lab-03-tfx-cicd/solutions/lab-03.ipynb | apache-2.0 | import yaml
# Set `PATH` to include the directory containing TFX CLI.
PATH=%env PATH
%env PATH=/home/jupyter/.local/bin:{PATH}
!python -c "import tfx; print('TFX version: {}'.format(tfx.__version__))"
"""
Explanation: CI/CD for TFX pipelines
Learning Objectives
Develop a CI/CD workflow with Cloud Build to build and... |
hongsups/insightfl_shin | project/property_values_zip_code_business_type.ipynb | mit | """ GET SF ZIP CODES from http://www.city-data.com/zipmaps/San-Francisco-California.html
"""
import itertools
sf_zip_codes = [94102, 94103, 94104, 94105, 94107, 94108, 94109, 94110, 94111, 94112, 94114, 94115, 94116, 94117, 94118, 94121, 94122, 94123, 94124, 94127, 94129, 94131, 94132, 94133, 94134, 94158]
"""
Exp... |
karlstroetmann/Artificial-Intelligence | Python/1 Search/Sphere-Search.ipynb | gpl-2.0 | def search(start, goal, next_states):
if goal == start:
return [start]
previous = basic_search(start, goal, next_states)
if previous:
return search(start, previous, next_states) + [goal]
def basic_search(start, goal, next_states):
Frontier = { start }
Visited = set()
while Fron... |
Jackporter415/phys202-2015-work | assignments/assignment04/TheoryAndPracticeEx02.ipynb | mit | from IPython.display import Image
"""
Explanation: Theory and Practice of Visualization Exercise 2
Imports
End of explanation
"""
# Add your filename and uncomment the following line:
Image(filename='Bad_Graph2.png')
"""
Explanation: Violations of graphical excellence and integrity
Find a data-focused visualization... |
google/consent-based-conversion-adjustments | cocoa/cocoa_template.ipynb | apache-2.0 | !pip install git+https://github.com/google/consent-based-conversion-adjustments.git
from IPython.display import clear_output
clear_output()
from itertools import combinations
import typing
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
np.random.seed(123)
from cocoa import nearest_consent... |
jve2kor/machine-learning-nanodegree | projects/image-classification/image_classification.ipynb | gpl-3.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
cifar10_dataset_folder_path = 'cifar-10-batches-py'
class DLProgress(tqdm):
last_block = 0
def hoo... |
bcorlett/Notebooks_Modelling | Corlett_Assign3.ipynb | mit | #Import toolboxes
from scipy import sparse #Allows me to create sparse matrices (i.e. not store all of the zeros in the 'A' matrix)
from scipy.sparse import linalg as linal
from numpy import * #To make matrices and do matrix manipulation
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: 12.850 - A... |
zzsza/TIL | pytorch/00. pytorch_summary.ipynb | mit | torch.Tensor.
# float이 default
"""
Explanation: http://pytorch.org/docs/master/
https://github.com/rguthrie3/DeepLearningForNLPInPytorch
1. What is a Pytorch?
텐서와 옵티마이저, 뉴럴넷 등 GPU 연산에 최적화된 모듈을 이용하여 빠르게 <strong>딥러닝 모델을 구현할 수 있는 프레임워크</strong> <br>
Facebook이 밀고 있던 lua 기반의 torch를 python 버전으로 포팅함
2. What is difference be... |
ftalbrecht/locally-conservative-rb | notebooks/linearelliptic_cg.ipynb | bsd-2-clause | g = grid.make_cube_grid__2d_simplex_aluconform(lower_left=[0, 0], upper_right=[1, 1], num_elements=[4, 4], num_refinements=2, overlap_size=[0, 0])
#g.visualize('grid')
"""
Explanation: $$\begin{align}\Omega &= [0, 1]^2\
\Gamma_D &= \partial\Omega\end{align}$$
End of explanation
"""
#bump = functions.make_expression_... |
hglanz/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
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
"""Print the sum of the arguments a and b."""
... |
Diyago/Machine-Learning-scripts | general studies/learning python/learning pandas/hw1_session3_data_analysis_pandas.ipynb | apache-2.0 | import numpy as np
import pandas as pd
"""
Explanation: Данные использовались в соревновании Ml Boot Camp 5.**
Вопросы в веб-форме.**
В соревновании предлагалось определить наличие/отсутствие сердечно-сосудистых заболеваний (ССЗ) по результатам осмотра пациента.
Описание данных.
Датасет сформирован из реальных клиниче... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a/td1a_correction_session3.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.1 - Dictionnaires, fonctions, code de Vigenère (correction)
Le notebook ne fait que crypter et décrypter un message sachant le code connu. Casser le code requiert quelques astuces décrites dnas ce notebook : casser le code de Vigenère.... |
SlipknotTN/udacity-deeplearning-nanodegree | embeddings/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
HakOh/python-practice | Function.ipynb | mit | def add(num1, num2):
return num1 + num2
result = add(232, 323)
print result
print add('abcd', 'efg')
#함수이름으로부터 기능이 명시되면 좋다.
def test_substraction(a, b):
return a - b
print test_substraction(5, 3)
#parameter(argument)
#int, string, float, list 등 어떤 파이썬 객체도 전달 가능
def len2(string):
return len(string)
de... |
Timathom/timathom.github.io | netsci/week3/shortest_thompson_timothy_rev1.ipynb | gpl-3.0 | def all_shortest_path_lengths_from(G, node):
"""
BSF implementation copied from MIT Open Courseware Lecture 13, Breadth-First Search (BSF):
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/lecture-13-breadth-first-search... |
ankdesh/Udacity-MachineLearning-Nanodegree | projects/titanic_survival_exploration/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 the RMS Titanic data... |
ImAlexisSaez/deep-learning-specialization-coursera | course_2/week_1/assignment_3/gradient_checking.ipynb | mit | # Packages
import numpy as np
from testCases import *
from gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, gradients_to_vector
"""
Explanation: Gradient Checking
Welcome to the final assignment for this week! In this assignment you will learn to implement and use gradient checking.
You are ... |
probml/pyprobml | notebooks/book2/22/flow_2d_mlp.ipynb | mit | from typing import Sequence
try:
import distrax
except ModuleNotFoundError:
%pip install -qq distrax
import distrax
try:
import haiku as hk
except ModuleNotFoundError:
%pip install -qq haiku
import haiku as hk
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
try:
import o... |
gschivley/Index-variability | Notebooks/Calculate national and NERC gen and emissions.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import os
from os.path import join
import sys
import json
idx = pd.IndexSlice
cwd = os.getcwd()
data_path = join(cwd, '..', 'Data storage')
"""
Explanation: Combine national and NERC data
Take the various file (EIA facilities, EIA state-level totals, EPA emissions, etc) and comb... |
ImAlexisSaez/deep-learning-specialization-coursera | course_2/week_1/assignment_1/initialization.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import sklearn
import sklearn.datasets
from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagation
from init_utils import update_parameters, predict, load_dataset, plot_decision_boundary, predict_dec
%matplotlib inline
plt.rcParams['f... |
ellisonbg/leafletwidget | examples/CustomTileServer.ipynb | mit | from multiprocessing import Process
from flask import Flask, Response
from requests import get as fetch
from ipyleaflet import Map, basemaps
"""
Explanation: Custom Tile Server
This example implements a minimal map tile server that serves map tiles from two different basemaps in a chess board pattern.
End of explanat... |
manmax31/MaterialRecognition | src/Others/caffe_classification.ipynb | apache-2.0 | print "The answer should be three: " + str(1+2)
"""
Explanation: Getting started with Caffe
This class was created by Allison Gray and Jon Barker.
The following timer counts down to a five minute warning before the lab instance shuts down. You should get a pop up at the five minute warning reminding you to save your ... |
willingc/geekgirl-2015 | intro_to_python/part-3.ipynb | gpl-2.0 | print("Happy Birthday, dear Carol!")
"""
Explanation: Introductions: Hi, I'm .... I'll be co-facilitating 'Programming with Python' with [our mentors names] and [our volunteers names]. If you would like to follow along and type in some of the snippets of code that we demo, our volunteers can assist you in setting up y... |
KUrushi/knocks | 01/chapter1.ipynb | mit | strings = "stressed"
print(strings[::-1])
"""
Explanation: 00 文字列の逆順
文字列"streesed"の文字を逆に並べた文字列を得よ
End of explanation
"""
strings1 = u"パタトクカシーー"
print(strings1[::2])
"""
Explanation: 01 パタトクカシーー
「パタトクカシーー」と言う文字列の1, 3, 5, 7文字目を取り出して連結した文字列を得よ
End of explanation
"""
strings_p = u"パトカー"
strings_t = u"タクシー"
strings_su... |
m2dsupsdlclass/lectures-labs | labs/05_conv_nets_2/Fully_Convolutional_Neural_Networks.ipynb | mit | %matplotlib inline
import warnings
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(1)
# Load a pre-trained ResNet50
# We use include_top = False for now,
# as we'll import output Dense Layer later
import tensorflow as tf
from tensorflow.keras.applications.resnet50 import ResNet50
base_model = ResN... |
khalido/nd101 | mnist_keras_cnn.ipynb | gpl-3.0 | from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
"""
Explanation: Keras is a high level wrapper (API) for Tensorflow and Theano which aims to make them easier to use. Tensorflow gets quite verbose and there is a lot of detail to handle, which Keras trys to abstract away to sane... |
atulsingh0/MachineLearning | python_DC/ST_Python_01a.ipynb | gpl-3.0 | # import
import pandas as pd
import numpy as np
import seaborn as sns
from sklearn.datasets import load_iris
import matplotlib.pyplot as plt
%matplotlib inline
# reading excel file
fh = pd.ExcelFile("dataset/EAVS.xlsx")
fh
print(fh.sheet_names)
data = fh.parse("SectionC")
data.head()
## Loading the IRIS dataset
ir... |
google/starthinker | colabs/dbm_to_sheets.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: DV360 Report To Sheets
Move existing DV360 report into a Sheets tab.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtai... |
google-research/google-research | aav/model_and_dataset_analysis/200609_figure4_shared.ipynb | apache-2.0 | import os
import numpy
import seaborn
import pandas
import matplotlib
import matplotlib.style
import matplotlib.patheffects
import matplotlib as mpl
from matplotlib import pyplot as pyplot
from scipy.spatial import distance
from IPython.display import display
from collections import OrderedDict
mpl.style.use('classic... |
UWashington-Astro300/Astro300-A17 | Python_Astroplan.ipynb | mit | import numpy as np
import astropy.units as u
from astropy.time import Time
from astropy.coordinates import SkyCoord
import pytz
from astroplan import Observer, FixedTarget
"""
Explanation: Planning observations with astroplan
End of explanation
"""
my_date1 = Time("2017-11-06 13:40:15", format='iso')
my_date1
my... |
leriomaggio/python-in-a-notebook | 07 Introduction to Functions.ipynb | mit | # Let's define a function.
def function_name(argument_1, argument_2):
# Do whatever we want this function to do,
# using argument_1 and argument_2
# Use function_name to call the function.
function_name(value_1, value_2)
"""
Explanation: Introducing Functions
One of the core principles of any programming lan... |
CamDavidsonPilon/lifelines | examples/Cox residuals.ipynb | mit | df = load_rossi()
df['age_strata'] = pd.cut(df['age'], np.arange(0, 80, 5))
df = df.drop('age', axis=1)
cph = CoxPHFitter()
cph.fit(df, 'week', 'arrest', strata=['age_strata', 'wexp'])
cph.print_summary()
cph.plot();
"""
Explanation: Assessing Cox model fit using residuals (work in progress)
This tutorial is on som... |
espenhgn/LFPy | examples/LFPy-example-10.ipynb | gpl-3.0 | import LFPy
import MEAutility as mu
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
"""
Explanation: Example 10: Extracellular stimulation of neurons
This is an example of LFPy running in an Jupyter notebook. To run through this example code and produce output, press <shi... |
DiceTechJobs/RelevancyTuning | Automated Relevancy Tuning using Black Box Optimization Algorithms.ipynb | mit | #Settings
# The files below are in the root folder of this GitHub repo. Launch jupyter notebook from that folder
# in order to read these files: 'jupyter notebook'
# Note: this is an artificial set of jobs, these are not real jobs, but are representative of our data
# Job descriptions are omitted, but usually we sear... |
saga-survey/saga-code | ipython_notebooks/HSC_PDR1_catalogs.ipynb | gpl-2.0 | import hosts
hostobjs = hosts.get_saga_hosts_from_google()
hosts.use_base_catalogs(hostobjs)
hschosts = tuple([h for h in hostobjs if h.name in ('Alice', 'Othello', 'Dune')])
assert len(hschosts) == 3
hschosts
for h in hschosts:
h.hscfn = os.path.join('catalogs', 'hsc_pdr1_{}.csv.gz'.format(h.name))
"""
Explanat... |
soundspotter/consonance | week1_consonance.ipynb | gpl-3.0 | from pylab import * # import matlab-like plotting and numerical functions
%matplotlib inline
rcParams['figure.figsize']=(12,6) # Set the detault size for figures to large
def dissonance(freqs, amps=None, params=None):
""" ... |
project-chip/connectedhomeip | docs/guides/repl/Matter - Access Control.ipynb | apache-2.0 | import os, subprocess
if os.path.isfile('/tmp/repl-storage.json'):
os.remove('/tmp/repl-storage.json')
# So that the all-clusters-app won't boot with stale prior state.
os.system('rm -rf /tmp/chip_*')
"""
Explanation: Access Control
<a href="http://35.236.121.59/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgith... |
mark-r-anderson/GaussianProcesses | sampling.ipynb | mit | def plotprior(x_star,y_sample_prior,title=''):
'''
Plot samples from the prior distribution with appropriate labels.
'''
plt.plot(x_star,y_sample_prior)
plt.xlabel('x')
plt.ylabel('f(x)')
plt.title('Prior Distribution\n'+title)
def plotposterior(x,y,x_star,y_sample_posterior,y_mean,title=''... |
gregcaporaso/sketchbook | 2015.07.02-scipy2015-experiments/human-genome.ipynb | bsd-3-clause | from __future__ import division
# variables defining the targeted region
chromosome = 21
start_pos = 33177777
end_pos = 33708621
# The file comes down as ``ensembl.txt`` - we can sniff that this is fasta, and then load into a sequence.
## The Ns in this sequence, I believe, are masked repeats or low-complexity regi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.