repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
hpi-epic/pricewars-merchant
docs/Working with Kafka data.ipynb
mit
import sys sys.path.append('../') """ Explanation: Working with Kafka data During a simulation, the producer and the marketplace are constantly logging sales and the activity on the market to Kafka. These information are organised in topics. In order to estimate customer demand and predict good prices, merchants can u...
kdestasio/online_brain_intensive
nipype_tutorial/notebooks/example_normalize.ipynb
gpl-2.0
!ls /data/ds000114/derivatives/fmriprep/sub-*/anat/*h5 """ Explanation: Example 3: Normalize data to MNI template This example covers the normalization of data. Some people prefer to normalize the data during the preprocessing, just before smoothing. I prefer to do the 1st-level analysis completely in subject space an...
yaricom/goNEAT
contents/notebooks/experiments_results.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd """ Explanation: Study of experiment results After execution of each experiment the results of execution will be saved in Numpy NPZ format. The saved data can be used to analyse and visualize the evolutionary process. In this ...
relopezbriega/mi-python-blog
content/notebooks/MachineLearningOverfitting.ipynb
gpl-2.0
# <!-- collapse=True --> # Importando las librerías que vamos a utilizar import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.cross_validation import train_test_split from sklearn.datasets import make_classification from sklearn.svm import SVC from sklearn.tree im...
jochym/abinitio-workshop
notebooks/02_Obliczenia.ipynb
cc0-1.0
# Import potrzebnych modułów %matplotlib inline from matplotlib import pyplot as plt import matplotlib as mpl import numpy as np from ase.build import bulk from ase import units import ase.io from IPython.core.display import Image from __future__ import division, print_function from ase import Atoms from ase.units imp...
slerch/ppnn
nn_postprocessing/notebooks/feature_importance.ipynb
mit
%load_ext autoreload %autoreload 2 %matplotlib inline from nn_src.imports import * from nn_src.utils import get_datasets #DATA_DIR = '/Users/stephanrasp/data/' # DATA_DIR = '/scratch/srasp/ppnn_data/' DATA_DIR = '/Volumes/SanDisk/data/ppnn_data/' aux_train_set, aux_test_set = get_datasets(DATA_DIR, 'aux_15_16.pkl', ...
ppham27/MLaPP-solutions
chap04/8.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy import stats """ Explanation: Whitening versus standardizing End of explanation """ raw_data = pd.read_csv("heightWeightData.txt", header=None, names=["gender", "height", "weight"]) raw_data.info() raw_data.head() ...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a_ml/td2a_correction_session_3A.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from jyquickhelper import add_notebook_menu add_notebook_menu() # Répare une incompatibilité entre scipy 1.0 et statsmodels 0.8. from pymyinstall.fix import fix_scipy10_for_statsmodels08 fix_scipy10_for_statsmodels08() """ Explanation: 2A.ml - Statistiques descript...
rashikaranpuria/Machine-Learning-Specialization
Classification/Week 2/Assignment 2/module-4-linear-classifier-regularization-assignment-blank.ipynb
mit
from __future__ import division import graphlab """ Explanation: Logistic Regression with L2 regularization The goal of this second notebook is to implement your own logistic regression classifier with L2 regularization. You will do the following: Extract features from Amazon product reviews. Convert an SFrame into a...
saullocastro/pyNastran
docs/quick_start/demo/bdf_demo.ipynb
lgpl-3.0
import os import pyNastran print (pyNastran.__file__) print (pyNastran.__version__) pkg_path = pyNastran.__path__[0] from pyNastran.bdf.bdf import BDF, read_bdf from pyNastran.utils import object_attributes, object_methods print("pkg_path = %s" % pkg_path) """ Explanation: BDF Demo The iPython notebook for this demo...
gobabiertoAR/datasets-portal
audiencias/Cleaner audiencias.ipynb
mit
from data_cleaner import DataCleaner input_path = "audiencias-raw.csv" output_path = "audiencias-clean.csv" dc = DataCleaner(input_path) import pandas as pd df = pd.read_csv("audiencias-clean.csv") map(print, df[df.root_dependencia_descripcion == "Presidencia de la Nación"].dependencia_descripcion.unique()) map(p...
Kaggle/learntools
notebooks/pandas/raw/ex_2.ipynb
apache-2.0
import pandas as pd pd.set_option("display.max_rows", 5) reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0) from learntools.core import binder; binder.bind(globals()) from learntools.pandas.summary_functions_and_maps import * print("Setup complete.") reviews.head() """ Explanation: ...
ericmjl/data-testing-tutorial
bonus-3-file-integrity.ipynb
mit
from hashlib import sha256, md5 m = sha256() m.update('hello'.encode('utf-8')) m.hexdigest() """ Explanation: File Integrity With file integrity, the basic question we are answering is: "Has the file changed since the last time you used it?" Hash (Browns) File integrity can be checked by checking the "hash" of a file...
mne-tools/mne-tools.github.io
0.18/_downloads/4d74528a24c597c5e2cf1e334cf2a4f0/plot_compute_covariance.ipynb
bsd-3-clause
import os.path as op import mne from mne.datasets import sample """ Explanation: Computing a covariance matrix Many methods in MNE, including source estimation and some classification algorithms, require covariance estimations from the recordings. In this tutorial we cover the basics of sensor covariance computations...
paulrevere4/udacity-deep-learning
assignment1/1_notmnist.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from scipy import ndimage from sklearn.line...
JShadowMan/package
python/course/ch02-syntax-and-container/基本语法.ipynb
mit
year = 2019 # 赋值表达式, 一行可以只写一个语句 month = 7; day = 23; hour = 22; minute = 11; second = 0 # 一行也可以写多个语句, 使用 ; 进行分隔 if 1900 < year < 2100 and 1 <= month <= 12 \ and 1 <= day <= 31 and 0 <= hour < 24 \ and 0 <= minute < 60 and 0 <= second < 60: # 多个物理行组成一个逻辑行 print("时间正确") """ Explanation: Python中的基本语法 Pyth...
marxav/hello-world
artificial_neural_network_101_numpy.ipynb
mit
import numpy as np import matplotlib.pyplot as plt """ Explanation: <a href="https://colab.research.google.com/github/marxav/hello-world-python/blob/master/artificial_neural_network_101_numpy.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Goal: imp...
atulsingh0/MachineLearning
scikit-learn/MatPlotLib_01.ipynb
gpl-3.0
# Create a figure of size 8x6 inches, 80 dots per inch plt.figure(figsize=(8, 6), dpi=80) # Create a new subplot from a grid of 1x1 plt.subplot(1, 1, 1) X = np.linspace(-np.pi, np.pi, 256, endpoint=True) C, S = np.cos(X), np.sin(X) # Plot cosine with a blue continuous line of width 1 (pixels) plt.plot(X, C, color="bl...
stevertaylor/NX01
nanograv9yr_makehdf5.ipynb
mit
stripped_pars = list(parfiles) for ii in range(len(stripped_pars)): stripped_pars[ii] = stripped_pars[ii].replace('9yv1.gls.par', '9yv1.gls.strip.par') stripped_pars[ii] = stripped_pars[ii].replace('9yv1.t2.gls.par', '9yv1.t2.gls.strip.par') for ii in range(len(stripped_pars)): os.system('awk \'($1 !~ /T2...
QuantCrimAtLeeds/PredictCode
quick_start/Generate example dataset.ipynb
artistic-2.0
import os, csv, lzma import numpy as np import open_cp.sources.chicago import geopandas as gpd import pyproj import shapely.geometry """ Explanation: Generate example dataset Using our favour source, Chicago: https://data.cityofchicago.org/Public-Safety/Crimes-2001-to-present/ijzp-q8t2 Geometry from https://data.cityo...
rice-solar-physics/hot_plasma_single_nanoflares
notebooks/compute_ebtel_results.ipynb
bsd-2-clause
import sys import os import subprocess import pickle import numpy as np sys.path.append(os.path.join(os.environ['EXP_DIR'],'ebtelPlusPlus/rsp_toolkit/python')) from xml_io import InputHandler,OutputHandler """ Explanation: Compute EBTEL Results Run the single- and two-fluid EBTEL models for a variety of inputs. This...
nickdavidhaynes/python-data-science-intro
week_1/intro_to_python.ipynb
mit
my_variable = 10 """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Welcome!" data-toc-modified-id="Welcome!-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Welcome!</a></div><div class="lev2 toc-item"><a href="#About-me" data-toc-modified-id="About-me-11"><span class="toc-item-num">1.1&nbsp;...
mohanprasath/Course-Work
certifications/code/boston_housing/boston_housing.ipynb
gpl-3.0
# Import libraries necessary for this project import numpy as np import pandas as pd from sklearn.cross_validation import ShuffleSplit # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the Boston housing dataset data = pd.read_csv('hou...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/recommendation_systems/solutions/content_based_using_neural_networks.ipynb
apache-2.0
%%bash pip freeze | grep tensor """ Explanation: Content-Based Filtering Using Neural Networks This notebook relies on files created in the content_based_preproc.ipynb notebook. Be sure to run the code in there before completing this notebook. Also, you'll be using the python3 kernel from here on out so don't forget t...
miykael/nipype_tutorial
notebooks/basic_joinnodes.ipynb
bsd-3-clause
from nipype import JoinNode, Node, Workflow from nipype.interfaces.utility import Function, IdentityInterface def get_data_from_id(id): """Generate a random number based on id""" import numpy as np return id + np.random.rand() def merge_and_scale_data(data2): """Scale the input list by 1000""" imp...
rmsare/scarplet
docs/source/examples/multiprocessing_example.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from functools import partial from multiprocessing import Pool import scarplet as sl from scarplet.datasets import load_synthetic from scarplet.WindowedTemplate import Scarp data = load_synthetic() # Define parmaters for search scale = 10 age = 10. angles = np.lins...
VectorBlox/PYNQ
Pynq-Z1/notebooks/examples/arduino_lcd18.ipynb
bsd-3-clause
from pynq import Overlay Overlay("base.bit").download() """ Explanation: Arduino LCD Example using AdaFruit 1.8" LCD Shield This notebook shows a demo on Adafruit 1.8" LCD shield. End of explanation """ from pynq.iop import Arduino_LCD18 from pynq.iop import ARDUINO lcd = Arduino_LCD18(ARDUINO) """ Explanation: 1....
numenta/nupic.research
projects/archive/dynamic_sparse/notebooks/ExperimentAnalysis-Comparisons.ipynb
agpl-3.0
%load_ext autoreload %autoreload 2 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import numpy as np import pandas as pd from ray.tune.commands import * from nupic.research.frameworks.dynamic...
dkillick/courses
course_content/notebooks/cartopy_intro.ipynb
gpl-3.0
import matplotlib.pyplot as plt import cartopy.crs as ccrs """ Explanation: Cartopy in a nutshell Cartopy is a Python package that provides easy creation of maps, using matplotlib, for the analysis and visualisation of geospatial data. In order to create a map with cartopy and matplotlib, we typically need to import p...
akloster/porekit-python
examples/squiggle_classifier_1/Read_Until_Efficiency.ipynb
isc
import matplotlib.pyplot as plt import numpy as np %matplotlib inline def sim_ru(ham_frequency, ham_duration, accuracy): # Monte-Carlo Style n = 1000000 ham = np.random.random(size=n)<ham_frequency durations = np.ones(n) accurate = np.random.random(size=n)<accuracy durations[ham & accurate] = h...
ES-DOC/esdoc-jupyterhub
notebooks/inm/cmip6/models/inm-cm4-8/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inm', 'inm-cm4-8', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: INM Source ID: INM-CM4-8 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbulen...
hail-is/hail
hail/python/hail/docs/tutorials/09-ggplot.ipynb
mit
ht = hl.utils.range_table(10) ht = ht.annotate(squared = ht.idx**2) """ Explanation: The Hail team has implemented a plotting module for hail based on the very popular ggplot2 package from R's tidyverse. That library is very fully featured and we will never be quite as flexible as it, but with just a subset of its fun...
markovmodel/adaptivemd
examples/tutorial/6_example_multi_traj_type.ipynb
lgpl-2.1
import sys, os """ Explanation: AdaptiveMD Example 6 - Multi-traj 0. Imports End of explanation """ from adaptivemd import Project """ Explanation: Alright, let's load the package and pick the Project since we want to start a project End of explanation """ # Use this to completely remove the example-worker projec...
lilleswing/deepchem
examples/tutorials/11_Putting_Multitask_Learning_to_Work.ipynb
mit
!curl -Lo conda_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py import conda_installer conda_installer.install() !/root/miniconda/bin/conda info -e !pip install --pre deepchem import deepchem deepchem.__version__ """ Explanation: Tutorial Part 11: Putting Multitask Lea...
ericmjl/systems-microbiology-hiv
02 Train and Test - Protease.ipynb
mit
# Read in the protease inhibitor data data = pd.read_csv('drug_data/hiv-protease-data.csv', index_col='SeqID') drug_cols = data.columns[0:8] feat_cols = data.columns[8:] # Read in the consensus data consensus = SeqIO.read('sequences/hiv-protease-consensus.fasta', 'fasta') consensus_map = {i:letter for i, letter in en...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/hadgem3-gc31-mh/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-mh', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: MOHC Source ID: HADGEM3-GC31-MH Topic: Ocean Sub-Topics: Timestepping Framewor...
swirlingsand/deep-learning-foundations
gans/batch-norm/Batch_Normalization_Exercises.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False) """ Explanation: Batch Normalization – Practice Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con...
sanchestm/gm-mosquito-sim
testing other features/.ipynb_checkpoints/randomwalk2d-checkpoint.ipynb
mit
def findquadrant(point,size): y,x = point halfsize = size/2 if x < -halfsize: if y > halfsize: return [0,0] if y < -halfsize: return [2,0] return [1,0] if x > halfsize: if y > halfsize: return [0,2] if y < -halfsize: return [2,2] return [1,2] if y > ha...
jmhsi/justin_tinker
data_science/courses/temp/courses/dl1/nlp.ipynb
apache-2.0
sl=1000 vocab_size=200000 PATH='data/aclImdb/' names = ['neg','pos'] trn,trn_y = texts_from_folders(f'{PATH}train',names) val,val_y = texts_from_folders(f'{PATH}test',names) """ Explanation: IMBD dataset and the sentiment classification task The large movie view dataset contains a collection of 50,000 reviews from I...
deeplycloudy/lmaworkshop
TRACER-2021/FirstLMAplots.ipynb
bsd-2-clause
# We could tediously build a list … # filenames = ['/data/Houston/realtime-tracer/LYLOUT_200524_210000_0600.dat.gz',] # Instead, let's read a couple hours at the same time. import sys, glob filenames = glob.glob('/data/Houston/130619/LYLOUT_130619_2[0-1]*.dat.gz') for filename in filenames: print(filename) import...
jseabold/statsmodels
examples/notebooks/autoregressions.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import pandas as pd import pandas_datareader as pdr import seaborn as sns from statsmodels.tsa.ar_model import AutoReg, ar_select_order from statsmodels.tsa.api import acf, pacf, graphics """ Explanation: Autoregressions This notebook introduces autoregression modelin...
armgilles/presentation
EPSI/I5/Projet Big Data/EP3/Regression.ipynb
mit
features = [col for col in data.columns if col not in "SalePrice"] features train = data[features] y = data.SalePrice #y = data['SalePrice'] train.head() y.head() sns.distplot(y) # Modele pour la regression from sklearn.linear_model import Ridge import sklearn sklearn.__version__ # Initialisation du model mod...
ProfessorKazarinoff/staticsite
content/code/statics/simple_statics_problem.ipynb
gpl-3.0
import numpy as np from numpy.linalg import inv np.set_printoptions(precision=3) """ Explanation: A Statics Problem Given: A weight of 22lbs is hung by a ring. The ring is held by two cords pulled apart. The cord A on the left is at an angle $\alpha$ = 45&deg; CW relative to the -x-axis (45&deg; above horazontal) The...
zhuangjun1981/retinotopic_mapping
retinotopic_mapping/examples/analysis_retinotopicmapping/Retinotopic_Mapping_Analysis_Template/2015-10-31_RetinotopicMappingAnalysisTemplate.ipynb
gpl-3.0
from IPython.display import Javascript,display from corticalmapping.ipython_lizard.html_widgets import raw_code_toggle raw_code_toggle() display(Javascript("""var nb = IPython.notebook; //var is_code_cell = (nb.get_selected_cell().cell_type == 'code') //var curr_idx = (nb.get...
robertutterback/robertutterback.github.io
courses/comp347/f20/hwk1-sol.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import pandas as pd %matplotlib inline """ Explanation: Homework 1 Due Wednesday, September 5 by 2:00 PM. Submit via handin as hwk1. Some helpful setup code. Feel free to add whatever else you might need. End of explanation """ df = pd.read_csv('1-1.csv', comment='...
justanr/notebooks
fizzbuzz_with_pynads.ipynb
mit
from pynads import Container class Person(Container): __slots__ = ('name', 'age') def __init__(self, name, age): self.name = name self.age = age def _get_val(self): return {'name': self.name, 'age': self.age} def __repr__(self): return "Person(name={!s}, age={!...
LimeeZ/phys292-2015-work
assignments/assignment05/InteractEx04.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 4 Imports End of explanation """ def random_line(m, b, sigma, size=10): """Create a line y = m*x + b + N(0,si...
csantill/AustinSIGKDD-DecisionTrees
notebooks/Decision Trees.ipynb
bsd-3-clause
from __future__ import print_function import os from IPython.display import Image import numpy as np import pandas as pd from sklearn import datasets from sklearn.cross_validation import train_test_split from sklearn.cross_validation import cross_val_score from sklearn import tree from sklearn.externals.six import ...
dnc1994/MachineLearning-UW
ml-foundations/backup/house-price/Predicting house prices.ipynb
mit
import graphlab """ Explanation: Fire up graphlab create End of explanation """ sales = graphlab.SFrame('home_data.gl/') sales """ Explanation: Load some house sales data Dataset is from house sales in King County, the region where the city of Seattle, WA is located. End of explanation """ graphlab.canvas.set_ta...
CommonClimate/teaching_notebooks
GEOL351/ENSO_recharge.ipynb
mit
%matplotlib inline import numpy as np from scipy import integrate import nitime.algorithms as tsa import nitime.utils as utils from nitime.viz import winspect from nitime.viz import plot_spectral_estimate import seaborn as sns sns.set_palette("Dark2") # define model parameters Tscale = 7.5 # in Kelvins tscale = 1/6....
kastnerkyle/kastnerkyle.github.io-nikola
blogsite/posts/introduction-to-gaussian-processes.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import matplotlib.pyplot as plt rng = np.random.RandomState(1999) n_samples = 1000 X = rng.rand(n_samples) y = np.sin(20 * X) + .05 * rng.randn(X.shape[0]) X_t = np.linspace(0, 1, 100) y_t = np.sin(20 * X_t) plt.scatter(X, y, color='steelblue', label='measured y') plt.plot(X_t, y_...
choderalab/yank
Yank/reports/YANK_Health_Report_Template.ipynb
mit
# Mandatory Settings store_directory = 'STOREDIRBLANK' analyzer_kwargs = ANALYZERKWARGSBLANK # Optional Settings decorrelation_threshold = 0.1 mixing_cutoff = 0.05 mixing_warning_threshold = 0.90 phase_stacked_replica_plots = False """ Explanation: YANK Simulation Health Report General Settings Mandatory Settings st...
google/starthinker
colabs/dv360_api_patch_from_bigquery.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: 1. Install Dependencies First install the libraries needed to execute recipes, this only needs to be done once, then click play. End of explanation """ CLOUD_PROJECT = 'PASTE PROJECT ID HERE' print("Cloud Project Set To: %s" % CLOUD_PROJECT) ...
Kaggle/learntools
notebooks/ml_explainability/raw/ex5_shap_advanced.ipynb
apache-2.0
import numpy as np import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import train_test_split import shap # Environment Set-Up for feedback system. from learntools.core import binder binder.bind(globals()) from learntools.ml_explainability.ex5 import * print("Setup Comp...
NEONInc/NEON-Data-Skills
code/Python/uncertainty/lidar-uncertainty .ipynb
gpl-2.0
import sys sys.version import gdal import h5py import numpy as np from math import floor import os import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Background In 2016 the NEON AOP flew the PRIN site in D11 on a poor weather day to ensure coverage of the site. The following day, the weather improved...
wcmitchell/insights-core
notebooks/Insights Core Tutorial.ipynb
apache-2.0
from insights.core import dr # Here's our component type with the clever name "component." # We could have named it anything. Insights Core provides several types # that we'll come to later. component = dr.new_component_type("component") """ Explanation: Red Hat Insights Core Insights Core is a framework for collect...
OpenWeavers/openanalysis
doc/Langauge/15 - Exception and Exception handling.ipynb
gpl-3.0
div = lambda x,y : x/y div(8,2) div(0/0) """ Explanation: Exceptions In an ideal situation, our program runs smoothly without any errors. However it is not always the case. Errors may be due to developer's fault or programmer's mistake or of computer. Source of some errors might be hard to undertsand. However it is ...
herruzojm/udacity-deep-learning
sentiment-rnn/.ipynb_checkpoints/Sentiment RNN Solution-checkpoint.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment_network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment_network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
tjwei/HackNTU_Data_2017
Week03/04-Speed-Limit.ipynb
mit
import tqdm import tarfile import pandas import matplotlib import matplotlib.pyplot as plt import numpy as np import PIL import gzip from urllib.request import urlopen %matplotlib inline matplotlib.style.use('ggplot') # progress bar tqdm.tqdm.pandas() # 檔案名稱格式 filename_format="M06A_{year:04d}{month:02d}{day:02d}.tar....
jonathanmorgan/msu_phd_work
methods/data_creation/prelim_month-create_Reliability_Names_data.ipynb
lgpl-3.0
import datetime print( "packages imported at " + str( datetime.datetime.now() ) ) """ Explanation: prelim_month - create Reliability_Names data 2016.12.04 - work log - prelim_month - create Reliability_Names original file name: 2016.12.04-work_log-prelim_month-create_Reliability_Names.ipynb This is the notebook where...
tensorflow/hub
examples/colab/tf2_arbitrary_image_stylization.ipynb
apache-2.0
# Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
tensorflow/docs-l10n
site/ja/r1/tutorials/keras/basic_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...
Cyianor/smc2017
solutions/code/Python/fheld/exI.ipynb
mit
import numpy as np from numpy.random import randn, choice, multinomial from scipy import stats import pandas as pd %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns sns.set_style() """ Explanation: SMC2017: Exercise set I Setup End of explanation """ class TooLittleSampleCoverage(Exception):...
jldinh/multicell
examples/06 - Growth and divisions.ipynb
mit
%matplotlib notebook """ Explanation: Preparation End of explanation """ import multicell import numpy as np """ Explanation: Imports End of explanation """ sim = multicell.simulation_builder.generate_cell_grid_sim(20, 20, 1, 1e-3) """ Explanation: Problem definition Simulation and tissue structure End of explan...
jdsanch1/SimRC
01. Parte 1/05. Clase 5/.ipynb_checkpoints/05Class NB-checkpoint.ipynb
mit
#importar los paquetes que se van a usar import pandas as pd import pandas_datareader.data as web import numpy as np from sklearn.cluster import KMeans import datetime from datetime import datetime import scipy.stats as stats import scipy as sp import scipy.optimize as optimize import scipy.cluster.hierarchy as hac imp...
mahieke/maschinelles_lernen
a2/excercise1.ipynb
mit
import pandas as pd import numpy as np import util import scipy.stats as scs %matplotlib inline url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data' cols =["CRIM","ZN","INDUS","CHAS","NOX","RM","AGE","DIS","RAD","TAX","PTRATIO","B","LSTAT","TGT"] boston = pd.read_csv(url, sep=" ", ski...
saga-survey/saga-code
ipython_notebooks/Spectra Combining.ipynb
gpl-2.0
spec_data_raw = table.Table.read('SAGADropbox/data/saga_spectra_raw.fits.gz') spec_data_raw """ Explanation: Load the spectroscopic data End of explanation """ # Just setting the dtype does *not* do the conversion of the values. It instead tells numpy to # re-interpret the same set of bits as thought they were int...
Upward-Spiral-Science/the-vat
Code/inferential_simulation_AL.ipynb
apache-2.0
# Import Necessary Libraries import numpy as np import os, csv, json from matplotlib import * from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.axes_grid1 import make_axes_locatable import scipy import itertools from sklearn.decomposition import PCA import skimage.measure...
jtwhite79/pyemu
examples/pstfrom_mf6.ipynb
bsd-3-clause
import os import shutil import numpy as np import pandas as pd import matplotlib.pyplot as plt import pyemu import flopy """ Explanation: Setting up a PEST interface from MODFLOW6 using the PstFrom class The PstFrom class is a generalization of the prototype PstFromFlopy class. The generalization in PstFrom means user...
mathnathan/notebooks
dissertation/GNN - 1D GMM Example.ipynb
mit
#p = GMM([0.1,0.3,0.6], np.array([[0.2,.01],[0.5,0.01],[0.8,0.01]])) p = GMM([0.4,0.6], np.array([[0.2,0.05],[0.65,.015]])) num_samples = 1000 beg = 0.0 end = 1.0 t = np.linspace(beg,end,num_samples) num_neurons = len(p.pis) colors = [np.random.rand(num_neurons,) for i in range(num_neurons)] p_y = p(t) p_max = p_y.max...
testedminds/sand
docs/Matrix visualization with Bokeh.ipynb
apache-2.0
from bokeh.sampledata.les_mis import data data.keys() len(data['nodes']) data['nodes'][0:5] """ Explanation: Introduction to Bokeh Bokeh is an open-source Python interactive visualization library from Continuum Analytics that targets modern web browsers for presentation. Bokeh includes an example of network visuali...
vascotenner/holoviews
doc/Tutorials/Columnar_Data.ipynb
bsd-3-clause
import numpy as np import pandas as pd import holoviews as hv from IPython.display import HTML hv.notebook_extension() """ Explanation: In this Tutorial we will explore how to work with columnar data in HoloViews. Columnar data has a fixed list of column headings, with values stored in an arbitrarily long list of rows...
gully/starfish-demo
demo4/notebooks/Cholesky_errors.ipynb
mit
import numpy as np CC_1d = np.fromfile('CC_test.npy') CC_1d.shape """ Explanation: Cholesky decomposition errors. gully February 2016 Starfish error #26 shows that there is some strange Cholesky-decomposition rounding error problem. In this demo, we will try to recreate the problem, characterize it, and solve it. W...
geoscixyz/computation
docs/case-studies/TDEM/TKC_ATEM.ipynb
mit
import numpy as np from scipy.constants import mu_0 import matplotlib.pyplot as plt import ipywidgets from SimPEG import EM, Mesh, Utils, Maps %matplotlib inline # import a solver. If you want to re-run the forward simulation or inversion, # make sure you have pymatsolver (https://github.com/rowanc1/pymatsolver) #...
mne-tools/mne-tools.github.io
0.20/_downloads/2be4fb4bf7f4e0825af6c222c396d97a/plot_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-sp...
edwardd1/phys202-2015-work
assignments/assignment12/FittingModelsEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Fitting Models Exercise 1 Imports End of explanation """ a_true = 0.5 b_true = 2.0 c_true = -4.0 """ Explanation: Fitting a quadratic curve For this problem we are going to work with the following mod...
ambonip/Analisi-Trab
Analisi thibya Brahms.ipynb
gpl-3.0
%matplotlib inline #importo le librerie import pandas as pd import os from __future__ import print_function,division import numpy as np import seaborn as sns os.environ["NLS_LANG"] = "ITALIAN_ITALY.UTF8" """ Explanation: <h2>Analisi comparativa dei metodi di dosaggio degli anticorpi anti recettore del TSH</h2> <h3>Met...
fullmetalfelix/ML-CSC-tutorial
MBTR.ipynb
gpl-3.0
# --- INITIAL DEFINITIONS --- from dscribe.descriptors import MBTR import numpy as np from visualise import view from ase import Atoms import matplotlib.pyplot as mpl """ Explanation: Many Body Tensor Representation MBTR is a global descriptor for a molecule/unit cell. It eliminates rotational, translational, and perm...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session03/Day4/Profiling_solns.ipynb
mit
import random import numpy as np from matplotlib import pyplot as plt """ Explanation: Profiling and Optimizing By C Hummels (Caltech) End of explanation """ string_list = ['the ', 'quick ', 'brown ', 'fox ', 'jumped ', 'over ', 'the ', 'lazy ', 'dog'] %%timeit output = "" for string in string_list: output+=st...
tcmoore3/mbuild
docs/tutorials/tutorial_polymers.ipynb
mit
import mbuild as mb class CH2(mb.Compound): def __init__(self): super(CH2, self).__init__() self.add(mb.Particle(name='C', pos=[0,0,0]), label='C[$]') # Add hydrogens self.add(mb.Particle(name='H', pos=[-0.109, 0, 0.0]), label='HC[$]') self.add(mb.Particle(name...
arasdar/DL
udacity-dl/CNN/cnn_bp-learning-curves.ipynb
unlicense
""" 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...
mne-tools/mne-tools.github.io
0.18/_downloads/9460321824116e4964fbe6d88d27462e/plot_cluster_stats_evoked.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne import io from mne.stats import permutation_cluster_test from mne.datasets import sample print(__doc__) """ Explanation: Permutation F-test on sensor data with 1D c...
maxalbert/paper-supplement-nanoparticle-sensing
notebooks/fig_7_frequency_change_vs_lateral_particle_position.ipynb
mit
import matplotlib.pyplot as plt import pandas as pd from style_helpers import style_cycle_fig7 %matplotlib inline plt.style.use('style_sheets/fig7.mplstyle') """ Explanation: Fig. 7: Frequency Change $\Delta f$ vs. Lateral Particle Position This notebook reproduces Fig. 7 in the paper, which shows the the frequency c...
metpy/MetPy
v0.12/_downloads/62a1acd718d4c5b9717787544d4cf09f/Gradient.ipynb
bsd-3-clause
import numpy as np import metpy.calc as mpcalc from metpy.units import units """ Explanation: Gradient Use metpy.calc.gradient. This example demonstrates the various ways that MetPy's gradient function can be utilized. End of explanation """ data = np.array([[23, 24, 23], [25, 26, 25], ...
mediagit2016/workcamp-maschinelles-lernen-grundlagen
17-12-11-workcamp-ml/2017-12-11-arbeiten-mit-dictionaries-10.ipynb
gpl-3.0
mktcaps = {'AAPL':538.7,'GOOG':68.7,'IONS':4.6}# Dictionary wird initialisiert print(type(mktcaps)) print(mktcaps) print(mktcaps.values()) print(mktcaps.keys()) print(mktcaps.items()) c=mktcaps.items() print c[0] mktcaps['AAPL'] #Gibt den Wert zurück der mit dem Schlüssel "AAPL" verknüpft ist mktcaps['GS'] #Fehler w...
datactive/bigbang
examples/experimental_notebooks/Collaboration Robustness.ipynb
mit
%matplotlib inline """ Explanation: This notebook explores how collaborative relationships form between mailing list participants over time. The hypothesis, loosely put, is that early exchanges are indicators of growing relationships or trust that should be reflected in information flow at later times. End of explanat...
thewtex/SimpleITK-Notebooks
65_Registration_FFD.ipynb
apache-2.0
import SimpleITK as sitk import registration_utilities as ru import registration_callbacks as rc from __future__ import print_function import matplotlib.pyplot as plt %matplotlib inline from ipywidgets import interact, fixed #utility method that either downloads data from the MIDAS repository or #if already downloa...
aufziehvogel/kaggle
two-sigma-rental-listing/notebooks/2.1-sk-engineering-numerical-features.ipynb
mit
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np %matplotlib inline df = pd.read_json('../data/raw/train.json') df['created'] = df['created'].apply(lambda row: pd.to_datetime(row)) """ Explanation: Numerical Features Engineering In this notebook we want to try to engineer...
NervanaSystems/neon_course
01 MNIST example.ipynb
apache-2.0
from neon.backends import gen_backend be = gen_backend(batch_size=128) """ Explanation: To explore this ipython notebook, press SHIFT+ENTER to progress to the next cell. Feel free to make changes, enter code, and hack around. You can create new code cells by selecting INSERT-&gt;Insert Cell Below MNIST Example MNIST ...
rishuatgithub/MLPy
hugging-face/3. Behind the pipeline.ipynb
apache-2.0
from transformers import AutoTokenizer checkpoint = "distilbert-base-uncased-finetuned-sst-2-english" tokenizer = AutoTokenizer.from_pretrained(checkpoint) raw_inputs = [ "I've been waiting for a HuggingFace course my whole life.", "I hate this so much!", ] inputs = tokenizer(raw_inputs, padding=True, trunc...
spacedrabbit/PythonBootcamp
Milestone Project 1- Walkthrough Steps Workbook.ipynb
mit
# For using the same code in either Python 2 or 3 from __future__ import print_function ## Note: Python 2 users, use raw_input() to get player input. Python 3 users, use input() """ Explanation: Milestone Project 1: Walk-through Steps Workbook Below is a set of steps for you to follow to try to create the Tic Tac To...
palrogg/foundations-homework
Data_and_databases/Homework_3_Paul_Ronga.ipynb
mit
!pip3 install bs4 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 sc...
tommyogden/maxwellbloch
docs/usage/structure.ipynb
mit
import numpy as np """ Explanation: Structure and Angular Momentum End of explanation """ print(np.sqrt(1/6/3)) print(np.sqrt(1/2/3)) """ Explanation: Adding Structure So far we've looked at simple 2 and 3 level systems, but to accurately model a physical system we may need to consider complex structures. For examp...
verdverm/pypge
notebooks/Dissertation/data_gen/nist_convert.ipynb
mit
from pypge.benchmarks import explicit import numpy as np import pandas as pd # visualization libraries import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # plot the visuals in ipython %matplotlib inline """ Explanation: Explicit 1D Benchmarks This file demonstrates how to generate, plot, and o...
YeoLab/single-cell-bioinformatics
notebooks/6.2_Batch_Correction.ipynb
bsd-3-clause
from __future__ import print_function # Interactive Python (IPython - now Jupyter) widgets for interactive exploration import ipywidgets # Numerical python library import numpy as np # PLotting library import matplotlib.pyplot as plt # Dataframes in python import pandas as pd # Linear model correction import patsy...
alephcero/adsProject
olds/modelosFinales.ipynb
gpl-3.0
import pandas as pd import numpy as np import os import sys import simpledbf %pylab inline import matplotlib.pyplot as plt import statsmodels.api as sm from sklearn.model_selection import train_test_split from sklearn import linear_model """ Explanation: Modelos finales Libraries End of explanation """ def runModel(...
feststelltaste/software-analytics
notebooks/Committer Distribution.ipynb
gpl-3.0
import py2neo import pandas as pd import matplotlib.pyplot as plt # display graphics directly in the notebook %matplotlib inline """ Explanation: Introduction In the last notebook, I showed you how easy it is to connect jQAssistant/neo4j with Python Pandas/py2neo. In this notebook, I show you a (at first glance) simpl...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/gapic/custom/showcase_custom_text_binary_classification_batch.ipynb
apache-2.0
import os import sys # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install -U google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex client library: Custom training text binary classification model for batch predictio...
evanmiltenburg/python-for-text-analysis
Chapters/Chapter 20 - Visualization and Statistics.ipynb
apache-2.0
# This is special Jupyter notebook syntax, enabling interactive plotting mode. # In this mode, all plots are shown inside the notebook! # If you are not using notebooks (e.g. in a standalone script), don't include this. %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Chapter 19 - Visualization and ...
phoebe-project/phoebe2-docs
2.1/tutorials/meshes.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" """ Explanation: Accessing and Plotting Meshes Setup Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ %matplotli...