repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
hiteshagrawal/python
udacity/nano-degree/ipython_notebook_tutorial (1).ipynb
gpl-2.0
# Hit shift + enter or use the run button to run this cell and see the results print 'hello world' # The last line of every code cell will be displayed by default, # even if you don't print it. Run this cell to see how this works. 2 + 2 # The result of this line will not be displayed 3 + 3 # The result of this line...
megatharun/basic-python-for-researcher
.ipynb_checkpoints/Tutorial 7 - Data Visualization and Plotting-checkpoint.ipynb
artistic-2.0
%matplotlib inline import matplotlib.pyplot as plt """ Explanation: <span style="color: #B40486">BASIC PYTHON FOR RESEARCHERS</span> by Megat Harun Al Rashid bin Megat Ahmad last updated: April 14, 2016 <span style="color: #29088A">7. Data Visualization and Plotting</span> The <span style="color: #0000FF">$Matplotli...
materialsproject/MPContribs
mpcontribs-portal/notebooks/contribs.materialsproject.org/get_started.ipynb
mit
name = "your-project-name" apikey = "your-api-key" # profile.materialsproject.org """ Explanation: MPContribs Walkthrough start with a materials detail page on MP with user contributions navigate to https://mpcontribs.org and explore apply for project on https://workshop-contribs.materialsproject.org/contribute (wai...
axbaretto/beam
examples/notebooks/documentation/transforms/python/elementwise/map-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...
vadim-ivlev/STUDY
handson-data-science-python/DataScience-Python3/SimilarMovies.ipynb
mit
import pandas as pd r_cols = ['user_id', 'movie_id', 'rating'] ratings = pd.read_csv('e:/sundog-consult/udemy/datascience/ml-100k/u.data', sep='\t', names=r_cols, usecols=range(3), encoding="ISO-8859-1") m_cols = ['movie_id', 'title'] movies = pd.read_csv('e:/sundog-consult/udemy/datascience/ml-100k/u.item', sep='|',...
postBG/DL_project
intro-to-rnns/Anna_KaRNNa.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...
probml/pyprobml
notebooks/book1/13/mlp_cifar_pytorch.ipynb
mit
import sklearn import scipy import scipy.optimize import matplotlib.pyplot as plt from mpl_toolkits import mplot3d from mpl_toolkits.mplot3d import Axes3D import seaborn as sns import warnings warnings.filterwarnings("ignore") import itertools import time from functools import partial import os import numpy as np fr...
compsocialscience/summer-institute
2018/materials/boulder/day2-digital-trace-data/BoulderSICSS.ipynb
mit
# Install tweepy # !pip install tweepy # Import the libraries we need import tweepy import json import time import networkx import os import matplotlib.pyplot as plt from collections import Counter # Authenticate! auth = tweepy.OAuthHandler("Consumer Key", "Consumer Secret") auth.set_access_token("Access Token", "Acc...
dvklopfenstein/PrincetonAlgorithms
notebooks/ElemSymbolTbls.ipynb
gpl-2.0
# Setup for running examples import sys import os sys.path.insert(0, '{GIT}/PrincetonAlgorithms/py'.format(GIT=os.environ['GIT'])) from AlgsSedgewickWayne.BST import BST # Function to convert keys to key-value pairs where # 1. the key is the letter and # 2. the value is the index into the key list get_kv = lambda ...
opengeostat/pygslib
pygslib/Ipython_templates/backtr_raw.ipynb
mit
#general imports import matplotlib.pyplot as plt import pygslib from matplotlib.patches import Ellipse import numpy as np import pandas as pd #make the plots inline %matplotlib inline """ Explanation: Testing the back normalscore transformation End of explanation """ #get the data in gslib format into a pa...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/hadgem3-gc31-hm/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'hadgem3-gc31-hm', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: NERC Source ID: HADGEM3-GC31-HM Topic: Atmos Sub-Topics: Dynamical Core, Radia...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160607화_12일차_(확률론적)선형 회귀 분석 Linear Regression Analysis/5.patsy 패키지 소개.ipynb
mit
from patsy import dmatrix, dmatrices np.random.rand(5) np.random.seed(0) x1 = np.random.rand(5) + 10 x2 = np.random.rand(5) * 10 x1, x2 dmatrix("x1") """ Explanation: patsy 패키지 소개 회귀 분석 전처리 패키지 encoding/transform/design matrix 기능 R-style formula 문자열 지원 design matrix dmatrix(fomula[, data]) R-style formula 문자열을 받...
enakai00/jupyter_NikkeiLinux
No4/Figure3 - Basic Animations.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from numpy.random import randint %matplotlib nbagg """ Explanation: [1-1] 動画作成用のモジュールをインポートして、動画を表示可能なモードにセットします。 End of explanation """ fig = plt.figure(figsize=(6,2)) subplot = fig.add_subplot(1,1,1) subplot.set_xlim(0,50) ...
batfish/pybatfish
docs/source/notebooks/interacting.ipynb
apache-2.0
import pandas as pd from pybatfish.client.session import Session from pybatfish.datamodel import * from pybatfish.datamodel.answer import * from pybatfish.datamodel.flow import * pd.set_option('display.max_colwidth', None) pd.set_option('display.max_columns', None) # Prevent rendering text between '$' as MathJax expre...
santipuch590/deeplearning-tf
dl_tf_BDU/3.RNN/ML0120EN-3.2-Review-LSTM-basics.ipynb
mit
import numpy as np import tensorflow as tf tf.reset_default_graph() sess = tf.InteractiveSession() """ Explanation: <a href="https://www.bigdatauniversity.com"><img src = "https://ibm.box.com/shared/static/jvcqp2iy2jlx2b32rmzdt0tx8lvxgzkp.png" width = 300, align = "center"></a> <h1 align=center><font size = 5>RECURR...
anthonyng2/FX-Trading-with-Python-and-Oanda
Oanda v1 REST-oandapy/05.00 Trade Management.ipynb
mit
from datetime import datetime, timedelta import pandas as pd import oandapy import configparser config = configparser.ConfigParser() config.read('../config/config_v1.ini') account_id = config['oanda']['account_id'] api_key = config['oanda']['api_key'] oanda = oandapy.API(environment="practice", a...
SylvainCorlay/bqplot
examples/Marks/Object Model/Pie.ipynb
apache-2.0
data = np.random.rand(3) pie = Pie(sizes=data, display_labels='outside', labels=list(string.ascii_uppercase)) fig = Figure(marks=[pie], animation_duration=1000) fig """ Explanation: Basic Pie Chart End of explanation """ n = np.random.randint(1, 10) pie.sizes = np.random.rand(n) """ Explanation: Update Data End of ...
nwjs/chromium.src
third_party/tensorflow-text/src/docs/guide/subwords_tokenizer.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...
roaminsight/roamresearch
BlogPosts/Translation_scaling_invariance_regression/Translation_and_scaling_invariance_in_regression_models.ipynb
apache-2.0
__author__ = 'Adam Foster and Nick Dingwall' """ Explanation: Translation and scaling invariance in regression models End of explanation """ from centering_and_scaling import * %matplotlib inline # A dataset: data = np.random.multivariate_normal( mean=[4, 0], cov=[[5, 2], [2, 3]], size=250) X, y = data[:, 0], ...
jon-young/cell-line-clust
doc/Biclustering.ipynb
gpl-2.0
dfFile = os.path.join('..', 'data', 'siRNA_dataframe.csv') RNAiDf = pd.read_csv(dfFile, index_col=0) RNAiDf.tail() """ Explanation: 2015 December 4-6 Loading and exploring UTSW RNAi dataset... End of explanation """ rplVals = np.nanmedian(RNAiDf.values, axis=0) for i,col in enumerate(RNAiDf.columns): RNAiDf[c...
dereneaton/RADmissing
sims_nb_simulations.ipynb
mit
## standard Python imports import glob import itertools from collections import OrderedDict, Counter ## extra Python imports import rpy2 ## required for tree plotting import ete2 ## used for tree manipulation import egglib ## used for coalescent simulations import numpy as np impor...
nicoguaro/AdvancedMath
notebooks/pde.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import rcParams """ Explanation: Partial differential equations End of explanation """ %matplotlib notebook rcParams['mathtext.fontset'] = 'cm' rcParams['font.size'] = 14 red = "#e41a1c" blue = "#377eb8" gra...
satishgoda/learning
python/jupyter/tutorial/jupyter_notebook.ipynb
mit
from IPython.display import FileLink, FileLinks """ Explanation: About This Jupyter notebook demonstrates the features of the Notebook!! http://jupyter-notebook.readthedocs.io End of explanation """ !ls -1rt *.png """ Explanation: Notebook Format JSON Viewing Notebooks http://nbviewer.jupyter.org Github suppo...
kratzert/RRMPG
examples/model_api_example.ipynb
mit
# Imports and Notebook setup from timeit import timeit import pandas as pd import numpy as np import matplotlib.pyplot as plt from rrmpg.models import CemaneigeGR4J from rrmpg.data import CAMELSLoader from rrmpg.tools.monte_carlo import monte_carlo from rrmpg.utils.metrics import calc_nse """ Explanation: Model API ...
mne-tools/mne-tools.github.io
0.21/_downloads/2212671cb1d04d466a35eb15470863da/plot_forward_sensitivity_maps.ipynb
bsd-3-clause
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import mne from mne.datasets import sample import matplotlib.pyplot as plt print(__doc__) data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif' fwd_fname = data_path + '/MEG/sample/sample_audvis-meg-eeg-...
Cristianobam/UFABC
Unidade5-Atividades.ipynb
mit
# Faça aqui o programa usando for n = int(input("De o valor de n: ")) total = 0 for n in range(1, n + 1): num = int(input('Número a ser somado: ')) total = total + (num**2) print(total) # Faça aqui o programa usando while teto = int(input('Número a serem somados: ')) total1 = 0 r = 0 while(r < teto): nume ...
kubeflow/kfserving-lts
docs/samples/explanation/alibi/moviesentiment/movie_review_explanations.ipynb
apache-2.0
!pygmentize moviesentiment.yaml !kubectl apply -f moviesentiment.yaml CLUSTER_IPS=!(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}') CLUSTER_IP=CLUSTER_IPS[0] print(CLUSTER_IP) SERVICE_HOSTNAMES=!(kubectl get inferenceservice moviesentiment -o jsonpath='{.s...
jepegit/cellpy
dev_utils/easyplot/EasyPlot_Dev.ipynb
mit
files = [f1, f2] names = [f1.name, f2.name] ezplt = easyplot.EasyPlot(files, names, figtitle="Test1") ezplt.plot() """ Explanation: Checking standard usage End of explanation """ easyplot.EasyPlot( files, names, figtitle="Test2", galvanostatic_normalize_capacity=True, all_in_one=True, dqdv_...
fortyninemaps/karta
doc/source/geointerface.ipynb
mit
from karta.examples import greenland from karta.vector.read import from_shape import shapely.geometry """ Explanation: Example using __geo_interface__ The __geo_interface__ specification suggested by Sean Gilles (gist) vastly expands the capabilities of Karta by making data interchange with external modules simple. Th...
tensorflow/docs-l10n
site/en-snapshot/guide/keras/save_and_serialize.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...
xmnlab/notebooks
DSP/phase/Phase-Difference.ipynb
mit
from matplotlib import pyplot as plt from numpy.fft import fft, ifft import numpy as np import pandas as pd %matplotlib inline def sine_signal( t: np.array, A: float, f: float, φ: float ) -> pd.Series: """ φ input in degree unit :param t: :type t: :param A: :type A: :param f: :typ...
ES-DOC/esdoc-jupyterhub
notebooks/dwd/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', 'dwd', 'sandbox-3', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: DWD Source ID: SANDBOX-3 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balance...
tuanavu/coursera-university-of-washington
machine_learning/4_clustering_and_retrieval/assigment/week3/.ipynb_checkpoints/module-5-decision-tree-assignment-1-blank-Graphlab-checkpoint.ipynb
mit
import graphlab graphlab.canvas.set_target('ipynb') """ Explanation: Identifying safe loans with decision trees The LendingClub is a peer-to-peer leading company that directly connects borrowers and potential lenders/investors. In this notebook, you will build a classification model to predict whether or not a loan pr...
hanhanwu/Hanhan_Data_Science_Practice
AI_Experiments/digit_recognition_Pytorch.ipynb
mit
%pylab inline import os import numpy as np import pandas as pd import imageio as io from sklearn.metrics import accuracy_score import torch # Get data from here: https://datahack.analyticsvidhya.com/contest/practice-problem-identify-the-digits/ seed = 10 rng = np.random.RandomState(seed) train = pd.read_csv('Train_...
dusenberrymw/incubator-systemml
samples/jupyter-notebooks/DML Tips and Tricks (aka Fun With DML).ipynb
apache-2.0
from systemml import MLContext, dml, jvm_stdout ml = MLContext(sc) print (ml.buildTime()) """ Explanation: Replace NaN with mode Use sample builtin function to create sample from matrix Count of Matching Values in two Matrices/Vectors Cross Validation Value-based join of two Matrices Filter Matrix to include only Fre...
schatzlab/biomedicalresearch
lectures/05.BinomialExponential/BinomialDistribution.ipynb
mit
import random results = [] for trial in xrange(10000): heads = 0 for i in xrange(100): flip = random.randint(0,1) if (flip == 0): heads += 1 results.append(heads) print results[1:10] import matplotlib.pyplot as plt plt.figure() plt.hist(results) plt.show() ## Plot the histogram...
mne-tools/mne-tools.github.io
0.24/_downloads/78ad76ea5b03c29b4b851b8b64f74b68/linear_model_patterns.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Romain Trachel <trachelr@gmail.com> # Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD-3-Clause import mne from mne import io, EvokedArray from mne.datasets import sample from mne.decoding import Vectorizer, get_coef from sklearn...
nilmtk/nilmtk
docs/manual/user_guide/nilmtk_api_tutorial.ipynb
apache-2.0
from nilmtk.api import API import warnings warnings.filterwarnings("ignore") """ Explanation: NILMTK Rapid Experimentation API This notebook demonstrates the use of NILMTK's ExperimentAPI - a new NILMTK interface which allows NILMTK users to focus on which experiments to run rather than on the code required to run...
jonasluz/mia-cg
Exercises/Exercícios#2.ipynb
unlicense
# Demonstração algébrica, sem código. # Desenho da parábola. # import math import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.axislines import SubplotZero def prep_axis(): """ Preparação dos eixos do gráfico """ fig = plt.figure(1) ax = Subplot...
sassoftware/sas-viya-machine-learning
image_recognition/car-damage-analysis/Car-Damage-Image-Analysis-for-Insurance.ipynb
apache-2.0
# import the required packages from swat import * from pprint import pprint import numpy as np import matplotlib.pyplot as plt import cv2 # define the function to display the processed image files. def imageShow(session, casTable, imageId, nimages): a = session.table.fetch(sastypes=False,sortby=[{'name':'_id_'}]...
jphall663/GWU_data_mining
10_model_interpretability/src/dt_surrogate.ipynb
apache-2.0
# imports import h2o from h2o.estimators.gbm import H2OGradientBoostingEstimator from h2o.estimators.deeplearning import H2ODeepLearningEstimator from h2o.backend import H2OLocalServer from IPython.display import Image from IPython.display import display import os import re import subprocess from subprocess import Cal...
metpy/MetPy
v0.12/_downloads/8c91fa5ab51e12860cfa1e679eaa746d/xarray_tutorial.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt import xarray as xr # Any import of metpy will activate the accessors import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.units import units """ Explanation: xarray with MetPy Tutorial xarray &lt;htt...
psas/liquid-engine-analysis
archive/aerobee-150-reconstruction/AJ11-26.ipynb
gpl-3.0
from math import pi, log # Physics g_0 = 9.80665 # kg.m/s^2 Standard gravity # Chemistry rho_rfna = 1500.0 # kg/m^3 Density of IRFNA rho_fa = 1130.0 # kg/m^3 Density of Furfuryl Alcohol rho_an = 1021.0 # kg/m^3 Density of Aniline # Data Isp = 209.0 # s Ave...
DS-100/sp17-materials
sp17/labs/lab11/lab11.ipynb
gpl-3.0
!pip install -U sklearn import numpy as np import pandas as pd %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import sklearn as skl import sklearn.linear_model as lm import scipy.io as sio !pip install -U okpy from client.api.notebook import Notebook ok = Notebook('lab11.ok') """ Explanatio...
quoniammm/mine-tensorflow-examples
fastAI/deeplearning1/nbs/statefarm.ipynb
mit
from theano.sandbox import cuda cuda.use('gpu0') %matplotlib inline from __future__ import print_function, division path = "data/state/" #path = "data/state/sample/" import utils; reload(utils) from utils import * from IPython.display import FileLink batch_size=64 """ Explanation: Enter State Farm End of explanation...
astarostin/MachineLearningSpecializationCoursera
course4/week1 - Биномиальный критерий для доли - demo.ipynb
apache-2.0
import numpy as np from scipy import stats %pylab inline """ Explanation: Биномиальный критерий для доли End of explanation """ n = 16 n_samples = 1000 samples = np.random.randint(2, size = (n_samples, n)) t_stat = map(sum, samples) pylab.hist(t_stat, bins = 16, color = 'b', range = (0, 16), label = 't_stat') pyl...
arborh/tensorflow
tensorflow/lite/experimental/micro/examples/micro_speech/train_speech_model.ipynb
apache-2.0
import os # A comma-delimited list of the words you want to train for. # The options are: yes,no,up,down,left,right,on,off,stop,go # All other words will be used to train an "unknown" category. os.environ["WANTED_WORDS"] = "yes,no" # The number of steps and learning rates can be specified as comma-separated # lists t...
phenology/infrastructure
applications/notebooks/stable/plot_kmeans_clusters-Light.ipynb
apache-2.0
import sys sys.path.append("/usr/lib/spark/python") sys.path.append("/usr/lib/spark/python/lib/py4j-0.10.4-src.zip") sys.path.append("/usr/lib/python3/dist-packages") import os os.environ["HADOOP_CONF_DIR"] = "/etc/hadoop/conf" import os os.environ["PYSPARK_PYTHON"] = "python3" os.environ["PYSPARK_DRIVER_PYTHON"] = "...
ecell/ecell4-notebooks
en/tests/Reversible.ipynb
gpl-2.0
%matplotlib inline from ecell4.prelude import * """ Explanation: Reversible This is for an integrated test of E-Cell4. Here, we test a simple reversible association/dissociation model in volume. End of explanation """ D = 1 radius = 0.005 N_A = 60 U = 0.5 ka_factor = 0.1 # 0.1 is for reaction-limited N = 20 # a n...
eds-uga/csci1360e-su16
lectures/L3 - Python Variables and Syntax.ipynb
mit
x = 2 """ Explanation: Lecture 3: Python Variables and Syntax CSCI 1360E: Foundations for Informatics and Analytics Overview and Objectives In this lecture, we'll get into more detail on Python variables, as well as language syntax. By the end, you should be able to: Define variables of string and numerical types, co...
vadim-ivlev/STUDY
handson-data-science-python/DataScience-Python3/ItemBasedCF.ipynb
mit
import pandas as pd r_cols = ['user_id', 'movie_id', 'rating'] ratings = pd.read_csv('e:/sundog-consult/udemy/datascience/ml-100k/u.data', sep='\t', names=r_cols, usecols=range(3), encoding="ISO-8859-1") m_cols = ['movie_id', 'title'] movies = pd.read_csv('e:/sundog-consult/udemy/datascience/ml-100k/u.item', sep='|',...
olivierverdier/demo-notebooks
PageRank.ipynb
mit
A1 = array([ [0, 1, 0, 0, 0, 0 ], [1, 0, 0, 0, 0, 1 ], [0, 0, 0, 1/3, 1/2, 0 ], [0, 0, 0, 0, 0, 0 ], [0, 0, 0, 1/3, 0, 0 ], [0, 0, 1, 1/3, 1/2, 0 ] ]) brus = 1/6*array([ [1,1,1,1,1,1], [1,1,1,1,1,1], [1,1,1,1,1,1], [1,1,1,1,1,1], [1,1,1,1,1,1], [1,1,1,1,1,1]...
amirfz/pinder
exploration/exploring_the_idea.ipynb
gpl-3.0
client = MongoClient('localhost:27017') db = client.arXivDB db.arXivfeeds.count() """ Explanation: connecting to mongodb End of explanation """ print(db.arXivfeeds.find_one().keys()) for item in db.arXivfeeds.find({'published_parsed': 2016}).sort('_id', pymongo.DESCENDING).limit(5): print(item['title']) #db.ar...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/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', 'nasa-giss', 'sandbox-3', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NASA-GISS Source ID: SANDBOX-3 Topic: Land Sub-Topics: Soil, Snow, Vegetation, En...
ES-DOC/esdoc-jupyterhub
notebooks/fio-ronm/cmip6/models/sandbox-1/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'fio-ronm', 'sandbox-1', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: FIO-RONM Source ID: SANDBOX-1 Topic: Atmos Sub-Topics: Dynamical Core, Radiation...
anonyXmous/CapstoneProject
sliderule_dsi_xml_exercise.ipynb
unlicense
from xml.etree import ElementTree as ET """ Explanation: XML example and exercise study examples of accessing nodes in XML tree structure work on exercise to be completed and submitted reference: https://docs.python.org/2.7/library/xml.etree.elementtree.html data source: http://www.dbis.informatik.uni-goettinge...
ES-DOC/esdoc-jupyterhub
notebooks/fio-ronm/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', 'fio-ronm', 'sandbox-3', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: FIO-RONM Source ID: SANDBOX-3 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Ener...
ray-project/ray
doc/source/tune/examples/hebo_example.ipynb
apache-2.0
# !pip install ray[tune] !pip install HEBO==0.3.2 """ Explanation: Running Tune experiments with HEBOSearch In this tutorial we introduce HEBO, while running a simple Ray Tune experiment. Tune’s Search Algorithms integrate with ZOOpt and, as a result, allow you to seamlessly scale up a HEBO optimization process - with...
irazhur/StatisticalMethods
examples/SDSScatalog/CorrFunc.ipynb
gpl-2.0
%load_ext autoreload %autoreload 2 import numpy as np import SDSS import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import copy # We want to select galaxies, and then are only interested in their positions on the sky. data = pd.read_csv("downloads/SDSSobjects.csv",usecols=['ra','dec','u','g',\ ...
ajdawson/python_for_climate_scientists
course_content/f2py-example/f2py_example.ipynb
gpl-3.0
import lanczos1 print(dir(lanczos1)) lanczos1.dfiltrq? """ Explanation: Calling Fortran code from Python: f2py f2py The program f2py is supplied with numpy. It wraps Fortran code into an extension module, allowing the Fortran code to be called directly from Python. The quick way First we'll build a Python module fro...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_algo/td1a_correction_session7.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 1A.algo - Programmation dynamique et plus court chemin (correction) Correction. End of explanation """ import pyensae.datasource pyensae.datasource.download_data("matrix_distance_7398.zip", website = "xd") import pandas df = pandas.re...
Atzingen/curso-IoT-2017
aula-03-python/Introducao-Python-01.ipynb
mit
print "Hello Python 2.7 !" """ Explanation: Introdução a linguagem Python (parte 1) Notebook para o curso de IoT - IFSP Piracicaba Gustavo Voltani von Atzingen Python - versão 2.7 Este notebook contém uma introdução aos comandos básicos em python. Serão cobertos os seguintes tópicos Print Comentários Atribuição de va...
smousavi05/EQTransformer
docs/source/downloading.ipynb
mit
from EQTransformer.utils.downloader import makeStationList, downloadMseeds """ Explanation: Downloading Continuous Data This notebook demonstrates the use of EQTransformer for downloading continuous data from seismic networks. End of explanation """ help(makeStationList) """ Explanation: You can use help() to learn...
simpeg/tutorials
notebooks/fundamentals/pixels_and_neighbors/mesh.ipynb
mit
%matplotlib inline import numpy as np from SimPEG import Mesh, Utils import matplotlib.pyplot as plt plt.set_cmap(plt.get_cmap('viridis')) # use a nice colormap! """ Explanation: The Mesh: Where do things live? <img src="images/FiniteVolume.png" width=70% align="center"> <h4 align="center">Figure 3. Anatomy of a fi...
scraperwiki/databaker
databaker/tutorial/Finding_your_way.ipynb
agpl-3.0
# Load in the functions from databaker.framework import * # Load the spreadsheet tabs = loadxlstabs("example1.xls") # Select the first table tab = tabs[0] print("The unordered bag of cells for this table looks like:") print(tab) """ Explanation: Opening and previewing This uses the tiny excel spreadsheet example1....
udibr/flavours-of-physics
sPlot.ipynb
mit
import numpy as np %matplotlib inline from matplotlib import pylab as plt import pandas as pd import evaluation folder = '../inputs/' agreement = pd.read_csv(folder + 'check_agreement.csv', index_col='id') """ Explanation: In the kaggle flavours of physics competition the admins wanted to test if the predictions tha...
paolorivas/homeworkfoundations
homeworkdata/Homework_3_Paolo_Rivas_Legua.ipynb
mit
from bs4 import BeautifulSoup from urllib.request import urlopen html_str = urlopen("http://static.decontextualize.com/widgets2016.html").read() document = BeautifulSoup(html_str, "html.parser") """ Explanation: Homework assignment #3 These problem sets focus on using the Beautiful Soup library to scrape web pages. Pr...
anhaidgroup/py_entitymatching
notebooks/guides/step_wise_em_guides/Sampling and Labeling.ipynb
bsd-3-clause
# Import py_entitymatching package import py_entitymatching as em import os import pandas as pd # Get the datasets directory datasets_dir = em.get_install_path() + os.sep + 'datasets' path_A = datasets_dir + os.sep + 'DBLP.csv' path_B = datasets_dir + os.sep + 'ACM.csv' path_C = datasets_dir + os.sep + 'tableC.csv' ...
kirichoi/tellurium
examples/notebooks/core/tesedmlExample.ipynb
apache-2.0
from __future__ import print_function import tellurium as te te.setDefaultPlottingEngine('matplotlib') %matplotlib inline import phrasedml antimony_str = ''' model myModel S1 -> S2; k1*S1 S1 = 10; S2 = 0 k1 = 1 end ''' phrasedml_str = ''' model1 = model "myModel" sim1 = simulate uniform(0, 5, 100) task1 =...
olivertomic/hoggorm
examples/PCA/PCA_on_cancer_data.ipynb
bsd-2-clause
import hoggorm as ho import hoggormplot as hop import pandas as pd import numpy as np """ Explanation: Principal component analysis (PCA) on cancer data This notebook illustrates how to use the hoggorm package to carry out principal component analysis (PCA) on a multivariate data set on cancer in men across OECD count...
google-research/google-research
yoto/colabs/plot_yoto_vae.ipynb
apache-2.0
import tensorflow as tf import tensorflow_hub as hub import tensorflow_datasets as tfds from io import StringIO, BytesIO import numpy as np import IPython.display import PIL.Image tf.compat.v1.enable_eager_execution() tf.compat.v1.enable_v2_behavior() #@title Plotting utilities # Plotting utils, taken from # https://...
Juanlu001/Charla-PyConES15-poliastro
Going to Mars with Python in 5 minutes.ipynb
mit
%matplotlib notebook import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import astropy.units as u from astropy import time from poliastro import iod from poliastro.plotting import plot from poliastro.bodies import Sun, Earth from poliastro.twobody import State from poliastro im...
egentry/dwarf_photo-z
dwarfz/data/get_data.ipynb
mit
from __future__ import division, print_function # give access to importing dwarfz import os, sys dwarfz_package_dir = os.getcwd().split("dwarfz")[0] if dwarfz_package_dir not in sys.path: sys.path.insert(0, dwarfz_package_dir) import dwarfz from dwarfz.hsc_credentials import credential from dwarfz.hsc_release_que...
metpy/MetPy
v0.7/_downloads/sigma_to_pressure_interpolation.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt from netCDF4 import Dataset, num2date import metpy.calc as mcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo from metpy.units import units """ Explanation: Sigma to Pressure Interpolation By ...
MasterRobotica-UVic/Control-and-Actuators
proportional_control.ipynb
gpl-3.0
def carSys(n, kp, d0): return d0*pow(1-0.1*kp,n) # The system starts at 11m from the wall d0 = 11 # optimal values of kp [0,10]: # 0 < kp < 10 # try different cases kp = 5.0 def interactiveCar(n): print("Total time: ", n*0.01, " seconds") print("Distance to wall: ", carSys(n, kp, d0) ) return inte...
mehmetcanbudak/JupyterWorkflow
JupyterWorkflow.ipynb
mit
URL = "https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD" from urllib.request import urlretrieve urlretrieve(URL, "Fremont.csv") !head Freemont.csv import pandas as pd data = pd.read_csv("Fremont.csv") data.head() data = pd.read_csv("Fremont.csv", index_col="Date", parse_dates=True) data.hea...
jtwhite79/pyemu
examples/working_stack_demo.ipynb
bsd-3-clause
%matplotlib inline import os import shutil import platform import numpy as np import pandas as pd import matplotlib.pyplot as plt import flopy import pyemu """ Explanation: Current working stack for setting up PEST interface End of explanation """ nam_file = "freyberg.nam" org_model_ws = "freyberg_sfr_update" m = fl...
afunTW/dsc-crawling
appendix_ptt/00_parse_article.ipynb
apache-2.0
import requests import re import json from bs4 import BeautifulSoup, NavigableString from pprint import pprint ARTICLE_URL = 'https://www.ptt.cc/bbs/Gossiping/M.1537847530.A.E12.html' """ Explanation: 爬取單一文章資訊 你有可能會遇到「是否滿18歲」的詢問頁面 解析 ptt.cc/bbs 裏面文章的結構 爬取文章 爬取留言 URL https://www.ptt.cc/bbs/Gossiping/M.1537847530.A....
roatienza/Deep-Learning-Experiments
versions/2020/cnn/code/cnn-siamese.ipynb
mit
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.keras.layers import Dense, Dropout, Input from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten from tensorflow.keras.models import Model from tensorflow.keras.la...
mlamoureux/PIMS_YRC
P_Data_analysis.ipynb
mit
# Get some basic tools %pylab inline from pandas import Series, DataFrame import pandas as pd #import pandas.io.data as web #from pandas_datareader import data, web #import pandas_datareader as pdr from pandas_datareader import data as pdr import fix_yahoo_finance # Here are apple and microsoft closing prices since 2...
mfouesneau/pyphot
examples/astropy_Sun_Vega.ipynb
mit
%matplotlib inline import pylab as plt import numpy as np import sys sys.path.append('../') from pyphot import astropy as pyphot from pyphot.astropy import Vega, Sun """ Explanation: pyphot - A tool for computing photometry from spectra Some examples are provided in this notebook Full documentation available at http...
ddtm/dl-course
Seminar9/Bonus-seminar.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Deep learning for Natural Language Processing Simple text representations, bag of words Word embedding and... not just another word2vec this time 1-dimensional convolutions for text Aggregating several data sour...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a/texte_langue.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 1A.2 - Deviner la langue d'un texte Comment deviner la langue d'un texte sans savoir lire la langue ? Ce notebook aborde les dictionnaires, les fichiers et les graphiques. End of explanation """ def read_file(filename): # ... re...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/Spark/Intro/Lab 1 - Hello Spark/Lab 1 - Hello Spark - Instructor.ipynb
apache-2.0
#Step 1 - sc is Spark Context, Execute Spark Context to see if its active in cluster #Note: Notice the programming language used sc #Step 1 - The spark context has a .version available to return the version of the spark driver application #Note: Different versions of spark application support additional functionalit...
calroc/joypy
docs/Zipper.ipynb
gpl-3.0
from notebook_preamble import J, V, define """ Explanation: This notebook is about using the "zipper" with joy datastructures. See the Zipper wikipedia entry or the original paper: "FUNCTIONAL PEARL The Zipper" by Gérard Huet Given a datastructure on the stack we can navigate through it, modify it, and rebuild it usi...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_dipole_fit.ipynb
bsd-3-clause
from os import path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.forward import make_forward_dipole from mne.evoked import combine_evoked from mne.simulation import simulate_evoked data_path = mne.datasets.sample.data_path() subjects_dir = op.join(data_path, 'subjects') fname_ave = op....
caseresearch/code-review
tutorials/jupyter_notebook_emcee/emcee_notebook.ipynb
mit
%matplotlib inline """ Explanation: The rad-ness of notebooks I use notebooks more often than I use an executable .py script. This is partially because notebooks were my first major introduction to python, but my continued use relates back to the fact that it allows me to break up problems I'm solving into different b...
kdmurray91/kwip-experiments
writeups/misc/sklearn-rice/clustering.ipynb
mit
cl = AgglomerativeClustering(16, compute_full_tree=True, affinity='precomputed', linkage='complete') np.unique(cl.fit_predict(wip_0.data), return_counts=True) """ Explanation: sklearn Agglomerative I can't get this to work properly. The values returned by fit_predict below should essentially be [[0, 1, 2, 3, 4, 5, 6,...
gururajl/deep-learning
dcgan-svhn/DCGAN.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
gregcaporaso/short-read-tax-assignment
ipynb/mock-community/taxonomy-assignment-template.ipynb
bsd-3-clause
from os.path import join, expandvars from joblib import Parallel, delayed from glob import glob from os import system from tax_credit.framework_functions import (parameter_sweep, generate_per_method_biom_tables, move_results_to_rep...
nonmean/nonmean.github.io
_notebooks/2020-09-01-fastcore.ipynb
mit
#hide ! pip install -U git+git://github.com/fastai/fastcore@master ! pip install -U git+git://github.com/fastai/nbdev@master ! pip install -U numpy from fastcore.foundation import * from fastcore.meta import * from fastcore.utils import * from fastcore.test import * from nbdev.showdoc import * from fastcore.dispatch im...
kdestasio/online_brain_intensive
nipype_tutorial/notebooks/basic_iteration.ipynb
gpl-2.0
from nipype import Node, Workflow from nipype.interfaces.fsl import BET, IsotropicSmooth # Initiate a skull stripping Node with BET skullstrip = Node(BET(mask=True, in_file='/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz'), name="skullstrip") """ Explanation: <i...
artfisica/notebooks
september_2018_v-2.0/ATLAS_OpenData_02-simple_python_example_histogram.ipynb
gpl-3.0
import ROOT """ Explanation: <CENTER> <a href="http://opendata.atlas.cern" class="icons"><img src="../images/opendata-top-transblack.png" style="width:40%"></a> </CENTER> A simple introductional notebook to HEP analysis in python <p> In this notebook you can find an easy set of commands that show the basic computi...
turi-code/tutorials
notebooks/datapipeline_recsys_intro.ipynb
apache-2.0
import graphlab """ Explanation: Making batch recommendations using GraphLab Create In this notebook we will show a complete recommender system implemented using GraphLab's deployment tools. This recommender example is common in many batch scenarios, where a new recommender is trained on a periodic basis, with the ge...
google-research/google-research
group_agnostic_fairness/data_utils/CreateCompasDatasetFiles.ipynb
apache-2.0
from __future__ import division import pandas as pd import numpy as np import json import os,sys import seaborn as sns import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import numpy as np """ Explanation: Copyright 2020 Google LLC. Licensed under the Apache License, Version 2.0 (the ...
brinkar/real-world-machine-learning
Chapter 2 - Data Processing.ipynb
mit
%pylab inline """ Explanation: Chapter 2: Processing data for machine learning To simplify the code examples in these notebooks, we populate the namespace with functions from numpy and matplotlib: End of explanation """ cat_data = array(['male', 'female', 'male', 'male', 'female', 'male', 'female', 'female']) def c...
calroc/joypy
docs/1. Basic Use of Joy in a Notebook.ipynb
gpl-3.0
from joy.joy import run from joy.library import initialize from joy.utils.stack import stack_to_string from joy.utils.pretty_print import TracePrinter """ Explanation: Preamble First, import what we need. End of explanation """ D = initialize() S = () def J(text): print stack_to_string(run(text, S, D)[0]) de...
msampathkumar/kaggle-quora-tensorflow
references/intro-to-rnns/Anna KaRNNa.ipynb
apache-2.0
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...
root-mirror/training
SoftwareCarpentry/04-histograms-and-graphs.ipynb
gpl-2.0
import ROOT h = ROOT.TH1D(name="h", title="My histo", nbinsx=100, xlow=-5, xup=5) h.FillRandom("gaus", ntimes=5000) """ Explanation: ROOT histograms Histogram class documentation ROOT has powerful histogram objects that, among other features, let you produce complex plots and perform fits of arbitrary functions. TH1...
samuxiii/notebooks
titanic/Titanic Survival Kaggle.ipynb
apache-2.0
import numpy as np import pandas as pd import seaborn as sns %matplotlib inline #load the files train = pd.read_csv('input/train.csv') test = pd.read_csv('input/test.csv') data = pd.concat([train, test]).reset_index(drop=True) #size of training dataset train_samples = train.shape[0] #print some of them data.head() ...