repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
GoogleCloudPlatform/vertex-ai-samples | notebooks/official/model_monitoring/model_monitoring.ipynb | apache-2.0 | import os
# The Google Cloud Notebook product has specific requirements
IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version")
# Google Cloud Notebook requires dependencies to be installed with '--user'
USER_FLAG = ""
if IS_GOOGLE_CLOUD_NOTEBOOK:
USER_FLAG = "--user"
import os
import... |
daniestevez/jupyter_notebooks | GPS_timing/GPS timing.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal
plt.rcParams['font.size'] = 14
plt.rcParams['figure.facecolor'] = 'w'
plt.rcParams['figure.figsize'] = (10, 5)
"""
Explanation: GPS timing
This notebook shows how to process the output of GNSS-DSP-tools to measure the time of tr... |
ClaudioVZ/Metodos_numericos_I | 01_Raices_de_ecuaciones_de_una_variable/06_Secante.ipynb | gpl-2.0 | def diferencia_atras(f, x_0, x_1):
pendiente = (f(x_0) - f(x_1))/(x_0 - x_1)
return pendiente
def raiz(f, a, b):
c = b - f(b)/diferencia_atras(f, a, b)
return b, c
"""
Explanation: Método de la secante
El método de la secante es una extensión del método de Newton-Raphson, la derivada de la función se... |
rice-solar-physics/hot_plasma_single_nanoflares | notebooks/plot_state_space.ipynb | bsd-2-clause | import os
import sys
import pickle
import numpy as np
import astropy.constants as const
import seaborn.apionly as sns
import matplotlib.pyplot as plt
from matplotlib import ticker
%matplotlib inline
plt.rcParams.update({'figure.figsize' : [8,8]})
"""
Explanation: Plot Temperature, Density, and Pressure State Space
... |
neoscreenager/JupyterNotebookWhirlwindTourOfPython | indic_nlp_examples.ipynb | gpl-3.0 | # The path to the local git repo for Indic NLP library
INDIC_NLP_LIB_HOME="e:\indic_nlp_library"
# The path to the local git repo for Indic NLP Resources
INDIC_NLP_RESOURCES="e:\indic_nlp_resources"
"""
Explanation: Indic NLP Library
The goal of the Indic NLP Library is to build Python based libraries for common text... |
usantamaria/ipynb_para_docencia | 04_python_algoritmos_y_funciones/algoritmos_y_funciones.ipynb | mit | """
IPython Notebook v4.0 para python 3.0
Librerías adicionales:
Contenido bajo licencia CC-BY 4.0. Código bajo licencia MIT.
(c) Sebastian Flores, Christopher Cooper, Alberto Rubio, Pablo Bunout.
"""
# Configuración para recargar módulos y librerías dinámicamente
%reload_ext autoreload
%autoreload 2
# Configuración... |
catalyst-cooperative/pudl | test/validate/notebooks/validate_plants_steam_ferc1.ipynb | mit | %load_ext autoreload
%autoreload 2
import sys
import pandas as pd
import sqlalchemy as sa
import pudl
import warnings
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(stream=sys.stdout)
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatter... |
seg/2016-ml-contest | DiscerningHaggis/Discerning_Haggis_Facies_Classification_sub1.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
import seaborn as sns
sns.set(style='whitegrid',
rc={'lines.linewidth': 2.5,
'figure.figsize'... |
sympy/scipy-2017-codegen-tutorial | notebooks/02-code-printers.ipynb | bsd-3-clause | from sympy import *
init_printing()
"""
Explanation: Code printers
The most basic form of code generation are the code printers. The convert SymPy expressions into the target language.
The most common languages are C, C++, Fortran, and Python, but over a dozen languages are supported. Here, we will quickly go over ea... |
ES-DOC/esdoc-jupyterhub | notebooks/thu/cmip6/models/ciesm/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'thu', 'ciesm', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: THU
Source ID: CIESM
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbulence Conve... |
kit-cel/wt | nt1/vorlesung/3_mod_demod/pulse_shaping.ipynb | gpl-2.0 | # importing
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 16}
plt.rc('font', **font)
plt.rc('text', usetex=matplotlib.checkdep_usetex(True))
matplotlib.rc('figure', figsize=(18, 8) )
"""
Explanation: Content a... |
flowmatters/veneer-py | doc/examples/functions/CreatingFunctionsAndVariables.ipynb | isc | import veneer
v = veneer.Veneer()
%matplotlib inline
"""
Explanation: Example for bulk function management
Shows:
Creating multiple modelled variables
Creating multiple functions of the same form, each using one of the newly created modelled variables
Applying multiple functions
End of explanation
"""
v.network().p... |
dunkhong/grr | colab/examples/demo.ipynb | apache-2.0 | %load_ext grr_colab.ipython_extension
import grr_colab
"""
Explanation: GRR Colab
End of explanation
"""
grr_colab.flags.FLAGS.set_default('grr_http_api_endpoint', 'http://localhost:8000/')
grr_colab.flags.FLAGS.set_default('grr_admin_ui_url', 'http://localhost:8000/')
grr_colab.flags.FLAGS.set_default('grr_auth_ap... |
besser82/shogun | doc/ipython-notebooks/intro/Introduction.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
#To import all Shogun classes
from shogun import *
import shogun as sg
"""
Explanation: Machine Learning with Shogun
By Saurabh Mahindre - <a href="https://github.com/Saurabh7">github.com/Saurabh7</a> as a part of ... |
aranzgeo/omf | notebooks/omf_cbi.ipynb | mit | import cbi
import cbi_plot
import z_order_utils
import numpy as np
%matplotlib inline
"""
Explanation: OMF.v2 Block Model Storage
Authors: Rowan Cockett, Franklin Koch <br>
Company: Seequent <br>
Date: March 3, 2019
Overview
The proposal below defines a storage algorithm for all sub block model formats in OMF.v2.
The ... |
shwsun/spot-analysis | plot_stock_market.ipynb | apache-2.0 | print(__doc__)
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
import datetime
import numpy as np
import matplotlib.pyplot as plt
try:
from matplotlib.finance import quotes_historical_yahoo_ochl
except ImportError:
# quotes_historical_yahoo_ochl was named quotes_historical_yaho... |
google-research/google-research | group_agnostic_fairness/data_utils/CreateUCIAdultDatasetFiles.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 ... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_read_noise_covariance_matrix.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from os import path as op
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis-cov.fif')
fname_evo = op.join(data_path,... |
ibm-cds-labs/pixiedust | notebook/data-load-samples/Load from Object Storage - Python.ipynb | apache-2.0 | import pixiedust
pixiedust.enableJobMonitor()
"""
Explanation: Loading data from Object Storage
You can load data from cloud storage such as Object Storage.
Prerequisites
Collect your Object Storage connection information:
Authorization URL (auth_url), e.g. https://identity.open.softlayer.com
Project ID (projectId)
... |
mdeff/ntds_2016 | project/reports/global_warming/E_Simou.ipynb | mit | import numpy as np
# Show matplotlib graphs inside the notebook.
%matplotlib inline
import os.path
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import plotly
import plotly.offline as py
py.init_notebook_mode(connected=True)
import plotly.graph_objs as go
import plotly.tools as tls
from sklea... |
ptpro3/ptpro3.github.io | Projects/Challenges/challenge_set_5_prashant.ipynb | mit | import pandas as pd
import patsy
import statsmodels.api as sm
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cross_validation import train_test_split
%matplotlib inline
df = pd.read_csv('2013_movies.csv')
df.head()
y, X = patsy.dmatrices('DomesticTotalGross ~ Budget + Runtime', data=df, return_t... |
ProfessorKazarinoff/staticsite | content/code/sympy/sympy_solving_equations-polymer-density-problem-different-values.ipynb | gpl-3.0 | from sympy import symbols, nonlinsolve
"""
Explanation: Sympy (sympy.org) is a Python package used for solving equations with symbolic math.
Using Python and SymPy we can write and solve equations that come up in Engineering.
The example problem below contains two equations with two unknown variables. You could use a... |
EBIvariation/eva-cttv-pipeline | data-exploration/complex-events/notebooks/hgvs-follow-up-part2.ipynb | apache-2.0 | from collections import defaultdict, Counter
from itertools import zip_longest
import json
import os
import re
import sys
import urllib
import numpy as np
import requests
from consequence_prediction.vep_mapping_pipeline.consequence_mapping import *
from eva_cttv_pipeline.clinvar_xml_io.clinvar_xml_io import *
from ev... |
ericmjl/Network-Analysis-Made-Simple | archive/4-cliques-triangles-structures-instructor.ipynb | mit | # Load the network. This network, while in reality is a directed graph,
# is intentionally converted to an undirected one for simplification.
G = cf.load_physicians_network()
# Make a Circos plot of the graph
from nxviz import CircosPlot
c = CircosPlot(G)
c.draw()
"""
Explanation: Load Data
As usual, let's start by ... |
m2dsupsdlclass/lectures-labs | labs/04_conv_nets/01_Convolutions.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from skimage.io import imread
from skimage.transform import resize
sample_image = imread("bumblebee.png")
sample_image= sample_image.astype("float32")
size = sample_image.shape
print("sample image shape: ", sample_image.shape)
plt.imshow(sample_i... |
charmasaur/digbeta | tour/traj_visualisation.ipynb | gpl-3.0 | %matplotlib inline
import os
import re
import math
import random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from fastkml import kml, styles
from shapely.geometry import Point, LineString
random.seed(123456789)
data_dir = 'data/data-ijcai15'
#fvisit = os.path.... |
jvbalen/cover_id | draft_notebooks/SHS_data_draft.ipynb | mit | %matplotlib inline
from __future__ import division, print_function
import numpy as np
import os
"""
Explanation: Sketches and progress for SHS I/O
End of explanation
"""
import SHS_data
uris, ids = SHS_data.read_uris()
"""
Explanation: Read a list of all available URI's
Python
def read_uris():
...
End of explanati... |
shareactorIO/pipeline | source.ml/jupyterhub.ml/notebooks/talks/ODSC/MasterClass/Mar-01-2017/SparkMLTensorflowAI-HybridCloud-ContinuousDeployment.ipynb | apache-2.0 | import numpy as np
import os
import tensorflow as tf
from tensorflow.contrib.session_bundle import exporter
import time
# make things wide
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
from IPython.display import clear_output, Image, display, HTML... |
4dsolutions/Python5 | BellCurve.ipynb | mit | import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
import math
"""
Explanation: Gaussian Distribution (Normal or Bell Curve)
Think of a Jupyter Notebook file as a Python script, but with comments given the seriousness they deserve, meaning inserted Youtubes if necessary. We also adopt a more ... |
jhconning/Dev-II | notebooks/SavingsCommit.ipynb | bsd-3-clause | import Contract
"""
Explanation: Time-inconsistent preferences and the demand for commitment services
The 'rational' or exponential discounter benchmark
Consider a simple extension to the standard intertemporal optimization problem (seen in an earlier notebook from two to three periods. A time-consistent exponential ... |
DavidObando/carnd | Term1/Labs/CarND-Keras-Lab/traffic-sign-classification-with-keras.ipynb | apache-2.0 | from urllib.request import urlretrieve
from os.path import isfile
from tqdm import tqdm
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_size=None):
self.total = total_size
self.update((block_num - self.last_block) * block_size)
self.last_block = b... |
rflamary/POT | notebooks/plot_gromov.ipynb | mit | # Author: Erwan Vautier <erwan.vautier@gmail.com>
# Nicolas Courty <ncourty@irisa.fr>
#
# License: MIT License
import scipy as sp
import numpy as np
import matplotlib.pylab as pl
from mpl_toolkits.mplot3d import Axes3D # noqa
import ot
"""
Explanation: Gromov-Wasserstein example
This example is designed to s... |
csdms/pymt | notebooks/frost_number.ipynb | mit | # Import standard Python modules
import numpy as np
import pandas
import matplotlib.pyplot as plt
# Import the FrostNumber PyMT model
import pymt.models
frost_number = pymt.models.FrostNumber()
"""
Explanation: Frost Number Model
Link to this notebook: https://github.com/csdms/pymt/blob/master/notebooks/frost_numbe... |
manipopopo/tensorflow | tensorflow/contrib/autograph/examples/notebooks/rnn_keras_estimator.ipynb | apache-2.0 | def parse(line):
"""Parses a line from the colors dataset."""
items = tf.string_split([line], ",").values
rgb = tf.string_to_number(items[1:], out_type=tf.float32) / 255.0
color_name = items[0]
chars = tf.one_hot(tf.decode_raw(color_name, tf.uint8), depth=256)
length = tf.cast(tf.shape(chars)[0], dtype=tf.i... |
aitatanit/metatlas | 4notebooks/old/examplenotebooks/Specify information about the experiment methods samples and files.ipynb | bsd-3-clause | myExperiment = metatlas_objects.Experiment(name = 'QExactive_Hilic_Pos_Actinobacteria_Phylogeny')
"""
Explanation: <h1>Create an experiment</h1>
End of explanation
"""
myPath = '/global/homes/b/bpb/ExoMetabolomic_Example_Data/'
myPath = '/project/projectdirs/metatlas/data_for_metatlas_2/20150324_LPSilva_BHedlund_chl... |
NathanYee/ThinkBayes2 | code/chap09.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import math
import numpy as np
from thinkbayes2 import Pmf, Cdf, Suite, Joint, EvalBinomialPmf
import thinkplot
"""
Explanation: Think Bayes: Chapter 9
This notebook presents code and exercises from... |
agile-geoscience/striplog | docs/tutorial/10_Extract_curves_into_striplogs.ipynb | apache-2.0 | data = """Comp Formation,Depth
A,100
B,200
C,250
D,400
E,600"""
"""
Explanation: Extract curves into striplogs
Sometimes you'd like to summarize or otherwise extract curve data (e.g. wireline log data) into a striplog (e.g. one that represents formations).
We'll start by making some fake CSV text — we'll make 5 format... |
ubcgif/gpgTutorials | notebooks/mag/MagneticDipoleApplet.ipynb | mit | from geoscilabs.mag.MagDipoleApp import MagneticDipoleApp
"""
Explanation: This is the <a href="https://jupyter.org/">Jupyter Notebook</a>, an interactive coding and computation environment. For this lab, you do not have to write any code, you will only be running it.
To use the notebook:
- "Shift + Enter" runs the c... |
crocha700/pyspec | examples/example_2d_spectra.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
%matplotlib inline
import seawater as sw
from pyspec import spectrum as spec
"""
Explanation: pyspec example notebook: 2D spectrum
This notebook showcases a basic usage of pyspec for computing 2D spectrum and its associated iso... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/emac-2-53-vol/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'emac-2-53-vol', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: EMAC-2-53-VOL
Topic: Seaice
Sub-Topics... |
wcmckee/wcmckee.com | posts/redtube.ipynb | mit | import requests
import json
import random
import getpass
#import couchdb
import pickle
import getpass
#!flask/bin/python
#from flask import Flask, jsonify
myusr = getpass.getuser()
print(myusr)
#couch = couchdb.Server()
with open('/home/{}/prn.pickle'.format(myusr), 'rb') as handle:
prnlis = pickle.load(handle... |
jsharpna/DavisSML | lectures/lecture6/lecture6.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib as mpl
import plotnine as p9
import matplotlib.pyplot as plt
import itertools
import warnings
warnings.simplefilter("ignore")
from sklearn import neighbors, preprocessing, impute, metrics, model_selection, linear_model, svm, feature_selection
from matplotlib.p... |
NuGrid/NuPyCEE | DOC/Capabilities/Including_radioactive_isotopes.ipynb | bsd-3-clause | # Import python modules
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
# Import the NuPyCEE codes
from NuPyCEE import sygma
from NuPyCEE import omega
"""
Explanation: Including Radioactive Isotopes in NuPyCEE
Prepared by: Benoit Côté
This notebook describe the radioactive isotope implementation ... |
vishalsrangras/env-setup | env-test/test.ipynb | mit | import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
%matplotlib inline
img = mpimg.imread('test.jpg')
plt.imshow(img)
"""
Explanation: Run all the cells below to make sure everything is working and ready to go. All cells should run without error.
Test Matplotlib and Plotting
End of exp... |
kkozarev/mwacme | notebooks/test_synchrotron.ipynb | gpl-2.0 | from matplotlib import pyplot as plt
%matplotlib inline
import math
import scipy.integrate as integrate
import numpy as np
import scipy.special as special
"""
Explanation: Development of Synchrotron model and fitting for MWA data
By Kamen Kozarev
End of explanation
"""
#Asymptotic synchrotron values
x=np.arange(1000... |
EvanBianco/Practical_Programming_for_Geoscientists | Part1b_Intro_to_scientific_computing.ipynb | apache-2.0 | layers = [0.23, 0.34, 0.45, 0.25, 0.23, 0.35]
uppers = layers[:-1]
lowers = layers[1:]
rcs = []
for pair in zip(lowers, uppers):
rc = (pair[1] - pair[0]) / (pair[1] + pair[0])
rcs.append(rc)
rcs
"""
Explanation: Lists
Before coming into the Notebook, spend some time in an interactive session learning about ... |
char-lie/python_presentations | numpy/arrays.ipynb | mit | from numpy import array
arr = array([1, 2, 3])
print(arr)
"""
Explanation: Arrays
NumPy deals just perfect with arrays, because of
- advanced overload of __getitem__ operator for indexing, which is handy;
- overload of other operators for comfortable shortcuts and intuitive interface;
- methods and functions implemen... |
bxin/cwfs | examples/AuxTel2001.ipynb | gpl-3.0 | from lsst.cwfs.instrument import Instrument
from lsst.cwfs.algorithm import Algorithm
from lsst.cwfs.image import Image, readFile, aperture2image, showProjection
import lsst.cwfs.plots as plots
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Tiago provided a pair of images from... |
smorton2/think-stats | code/chap10ex.ipynb | gpl-3.0 | from __future__ import print_function, division
%matplotlib inline
import numpy as np
import random
import thinkstats2
import thinkplot
"""
Explanation: Examples and Exercises from Think Stats, 2nd Edition
http://thinkstats2.com
Copyright 2016 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
End of... |
topix-hackademy/pandas-for-dummies | 01_SERIES/CSV-Reader.ipynb | mit | import pandas as pd
asd = pd.read_csv("data/input.csv")
print type(asd)
asd.head()
# This is a Dataframe because we have multiple columns!
"""
Explanation: Read Data From CSV
Method:
read_csv
End of explanation
"""
data = pd.read_csv("data/input.csv", usecols=["name"], squeeze=True)
print type(data)
data.head()
da... |
ucsd-ccbb/Oncolist | notebooks/Oncolist Server API Examples.ipynb | mit | import os
import sys
sys.path.append(os.getcwd().replace("notebooks", "cfncluster"))
## S3 input and output address.
s3_input_files_address = "s3://path/to/input folder"
s3_output_files_address = "s3://path/to/output folder"
## CFNCluster name
your_cluster_name = "cluster_name"
## The private key pair for accessing... |
snowicecat/umich-eecs445-f16 | lecture16_pgms_latent_vars_cond_independence/lecture16_pgms_latent_vars_cond_independence.ipynb | mit | from __future__ import division
# scientific
%matplotlib inline
from matplotlib import pyplot as plt;
import numpy as np;
import sklearn as skl;
import sklearn.datasets;
import sklearn.cluster;
# ipython
import IPython;
# python
import os;
#####################################################
# image processing
im... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/ml_fairness_explainability/explainable_ai/labs/xai_image_vertex.ipynb | apache-2.0 | # Install needed deps
!pip install opencv-python
"""
Explanation: AI Explanations: Deploying an Explainable Image Model with Vertex AI
Overview
This lab shows how to train a classification model on image data and deploy it to Vertex AI to serve predictions with explanations (feature attributions). In this lab you will... |
ljubisap/ml-dojo-part-I | Do it yourself.ipynb | apache-2.0 | # TODO Create one string, int, float and boolean variable and print them out
"""
Explanation: Do it yourself...
Python basics
End of explanation
"""
# TODO Check what above given functions will produce from following variables:
a = 'Some test string...'
b = 'WE ARE LEARNING...'
c = 123
# TODO Concatenate all variab... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_11/Final/.ipynb_checkpoints/Resampling-checkpoint.ipynb | bsd-3-clause | # min: minutes
my_index = pd.date_range('9/1/2016', periods=9, freq='min')
my_index
"""
Explanation: Resampling
documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.resample.html
For arguments to 'freq' parameter, please see Offset Aliases
create a date range to use as an index
End of... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/text_classification/solutions/LSTM_IMDB_Sentiment_Example.ipynb | apache-2.0 | # keras.datasets.imdb is broken in TensorFlow 1.13 and 1.14 due to numpy 1.16.3
!pip install numpy==1.16.2
# All the imports!
import tensorflow as tf
import numpy as np
from tensorflow.keras.preprocessing import sequence
from numpy import array
# Supress deprecation warnings
import logging
logging.getLogger('tensorf... |
musketeer191/job_analytics | .ipynb_checkpoints/Skill_Analysis-checkpoint.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import sklearn.feature_extraction.text as text_manip
import matplotlib.pyplot as plt
import gc
from sklearn.decomposition import NMF, LatentDirichletAllocation
from time import time
from scipy.sparse import *
from my_util import *
"""
Explanation: Preparations
Import libraries... |
jtwhite79/pyemu | examples/Freyberg/.ipynb_checkpoints/verify_unc_results-checkpoint.ipynb | bsd-3-clause | %matplotlib inline
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyemu
"""
Explanation: verify pyEMU results with the henry problem
End of explanation
"""
la = pyemu.Schur("freyberg.jcb",verbose=False)
la.drop_prior_information()
jco_ord = la.jco.get(la.pst.obs_names,la.pst.... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/ukesm1-0-ll/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'ukesm1-0-ll', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: MOHC
Source ID: UKESM1-0-LL
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Tu... |
morganics/bayesianpy | examples/notebook/iris_gaussian_mixture_model.ipynb | apache-2.0 | %matplotlib notebook
import pandas as pd
import sys
sys.path.append("../../../bayesianpy")
import bayesianpy
from bayesianpy.network import Builder as builder
import logging
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
# Using the latent variable to cluster ... |
mne-tools/mne-tools.github.io | stable/_downloads/fcc5782db3e2930fc79f31bc745495ed/60_ctf_bst_auditory.ipynb | bsd-3-clause | # Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD-3-Clause
import os.path as op
import pandas as pd
import numpy as np
import mne
from mne import combine_evoked
from mne.minimum_norm import ... |
ericfourrier/auto-clean | examples/other_notebooks/Tidy Data.ipynb | mit | import pandas as pd
import numpy as np
# tuberculosis (TB) dataset
path_tb = '/Users/ericfourrier/Documents/ProjetR/tidy-data/data/tb.csv'
df_tb = pd.read_csv(path_tb)
df_tb.head(20)
"""
Explanation: Tidy Data
Thsis notebbok is designed to explore Hadley Wickman article about tidy data using pandas
The datasets are ... |
jonathf/chaospy | docs/user_guide/advanced_topics/gaussian_mixture_model.ipynb | mit | import chaospy
means = ([0, 1], [1, 1], [1, 0])
covariances = ([[1.0, -0.9], [-0.9, 1.0]],
[[1.0, 0.9], [ 0.9, 1.0]],
[[0.1, 0.0], [ 0.0, 0.1]])
distribution = chaospy.GaussianMixture(means, covariances)
distribution
import numpy
from matplotlib import pyplot
pyplot.rc("figure", figsiz... |
BBN-Q/Auspex | doc/examples/Example-Calibrations.ipynb | apache-2.0 | from QGL import *
from auspex.qubit import *
"""
Explanation: Example Q6: Calibrations
This example notebook shows how to use the pulse calibration framework.
© Raytheon BBN Technologies 2019
End of explanation
"""
cl = ChannelLibrary("my_config")
pl = PipelineManager()
"""
Explanation: We use a pre-existing databa... |
Tatiana-Krivosheev/ipython-notebooks-physics | PHYS2211.Measurement.ipynb | cc0-1.0 | import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import sympy
%matplotlib inline
"""
Explanation: PHYS 2211 - Introductory Physics Laboratory I
Measurement andError Propagation
Name: Tatiana Krivosheev
Partners: Oleg Krivosheev
Annex A
End of explanation
"""
class ListTable(list):
""" Over... |
darienmt/intro-to-tensorflow | LeNet-Lab.ipynb | mit | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("./datasets/", reshape=False)
X_train, y_train = mnist.train.images, mnist.train.labels
X_validation, y_validation = mnist.validation.images, mnist.validation.labels
X_test, y_test = mnist.test.images, mn... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/kubeflow_pipelines/cicd/labs/kfp_cicd_vertex.ipynb | apache-2.0 | PROJECT_ID = !(gcloud config get-value project)
PROJECT_ID = PROJECT_ID[0]
REGION = "us-central1"
ARTIFACT_STORE = f"gs://{PROJECT_ID}-kfp-artifact-store"
"""
Explanation: CI/CD for a Kubeflow pipeline on Vertex AI
Learning Objectives:
1. Learn how to create a custom Cloud Build builder to pilote Vertex AI Pipelines
1... |
hanhanwu/Hanhan_Data_Science_Practice | AI_Experiments/LSTM_changing_batch_size.ipynb | mit | from tensorflow import set_random_seed
set_random_seed(410)
from keras.layers import Dense
from keras.layers import LSTM
from keras.models import Sequential
import pandas as pd
# Generate data
## create sequence
length = 10
sequence = [i/float(length) for i in range(length)]
print sequence
## create X/y pairs
df = ... |
tensorflow/docs-l10n | site/zh-cn/guide/function.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... |
enakai00/jupyter_ml4se_commentary | Solutions/06-pandas DataFrame-02-solution.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
"""
Explanation: データフレームからのデータの抽出
End of explanation
"""
from numpy.random import normal
def create_dataset(num):
data_x = np.linspace(0,1,num)
data_y = np.sin(2*np.pi*data_x) + normal(loc=0, scale=0.... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/prod/n00_datasets_generation.ipynb | mit | # Basic imports
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
from time import time
from sklearn.metrics import r2_score, median_absolute_error
%matplotlib inline
%pylab inline
pylab.rcParams['figure.figsize'] = (20.0, 10... |
kjihee/lab_study_group | 2018/CodingInterview/Lecture_note/lecture_1.ipynb | mit | def find_overlap(string):
# 아스키 코드로 변환
convert_ord = [ord(i) for i in string]
# 아스키 코드는 0~255 의 수 : ex("A":65)
if len(set(convert_ord)) > 255:
return False
hash = [False] * 256
for i in convert_ord:
if hash[i] is True:
return False
else:
... |
brclark-usgs/flopy | examples/Notebooks/flopy3_array_outputformat_options.ipynb | bsd-3-clause | %matplotlib inline
import sys
import os
import platform
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import flopy
#Set name of MODFLOW exe
# assumes executable is in users path statement
version = 'mf2005'
exe_name = 'mf2005'
if platform.system() == 'Windows':
exe_name = 'mf2005.ex... |
weikang9009/pysal | notebooks/explore/segregation/decomposition_wrapper_example.ipynb | bsd-3-clause | import pandas as pd
import pickle
import numpy as np
import matplotlib.pyplot as plt
from pysal.explore import segregation
from pysal.explore.segregation.decomposition import DecomposeSegregation
"""
Explanation: Decomposition framework of the PySAL segregation module
This is a notebook that explains a step-by-step p... |
crowd-course/datascience | Error Analysis and Classification Measures.ipynb | mit | from __future__ import division
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import json
from sklearn.cross_validation import KFold
from sklearn.preprocessing import StandardScaler
from sklearn.cross_validation import train_test_split
from sklearn.svm import SVC
from sklearn.ensemble import R... |
ddyy345/trajAPI | test/testAPI_propane.ipynb | mit | import itertools
import string
import os
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from msibi import MSIBI, State, Pair, mie
import mdtraj as md
"""
Explanation: testAPI_propane
Created by Davy Yue 2017-06-22
Imports
End of explanation
"""
t = md.load('traj_unwrapped.dcd', top='start_aa... |
dedx/STAR2015 | notebooks/CountingStarsWithNumPy.ipynb | mit | import scipy.ndimage as ndi
import requests
from StringIO import StringIO
#Pick an image from the list above and fetch it with requests.get
#The default picture here is of M45 - the Pleiades Star Cluster.
response = requests.get("http://imgsrc.hubblesite.org/hu/db/images/hs-2004-20-a-large_web.jpg")
pic = ndi.imread(... |
BrownDwarf/ApJdataFrames | notebooks/Luhman2009.ipynb | mit | %pylab inline
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
"""
Explanation: ApJdataFrames 009: Luhman2009
Title: An Infrared/X-Ray Survey for New Members of the Taurus Star-Forming Region
Authors: Kevin L Luhman, E. E. Mamajek, P R Allen, and Kelle L Cruz
Data is from t... |
xsolo/machine-learning | face_detect/MLPClassifier.ipynb | mit | data = pd.read_csv('fer2013/fer2013.csv')
df = shuffle(df)
X = data['pixels']
y = data['emotion']
X = pd.Series([np.array(x.split()).astype(int) for x in X])
# convert one column as list of ints into dataframe where each item in array is a column
X = pd.DataFrame(np.matrix(X.tolist()))
df = pd.DataFrame(y)
df.loc[:,... |
CNS-OIST/STEPS_Example | user_manual/source/API_2/Interface_Tutorial_2_IP3.ipynb | gpl-2.0 | import steps.interface
from steps.model import *
from steps.geom import *
from steps.rng import *
from steps.sim import *
from steps.saving import *
r = ReactionManager()
mdl = Model()
with mdl:
Ca, IP3, R, RIP3, Ropen, RCa, R2Ca, R3Ca, R4Ca = Species.Create()
surfsys = SurfaceSystem.Create()
with ... |
ES-DOC/esdoc-jupyterhub | notebooks/nims-kma/cmip6/models/sandbox-3/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-3', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NIMS-KMA
Source ID: SANDBOX-3
Topic: Ocean
Sub-Topics: Timestepping Framework, A... |
locationtech/geowave | examples/data/notebooks/jupyter/geowave-gdelt.ipynb | apache-2.0 | #!pip install --user --upgrade pixiedust
import pixiedust
import geowave_pyspark
pixiedust.enableJobMonitor()
"""
Explanation: Import pixiedust
Start by importing pixiedust which if all bootstrap and install steps were run correctly.
You should see below for opening the pixiedust database successfully with no errors... |
edwardd1/phys202-2015-work | assignments/assignment06/InteractEx05.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import display
from IPython.display import (
display_pretty, display_html, display_jpeg,
display_png, display_json, display_latex, display_svg
)
from IPython.display import SVG
from IPython.html.widgets import interact, ... |
liufuyang/deep_learning_tutorial | jizhi-pytorch-2/03_text_generation/RNNGenerative/MIDIComposer.ipynb | mit | # 导入必须的依赖包
# 与PyTorch相关的包
import torch
import torch.utils.data as DataSet
import torch.nn as nn
from torch.autograd import Variable
import torch.optim as optim
# 导入midi音乐处理的包
from mido import MidiFile, MidiTrack, Message
# 导入计算与绘图必须的包
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explan... |
adrianstaniec/deep-learning | 08_transfer-learning/Transfer_Learning.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session08/Day1/ThisLaptopIsInadequate.ipynb | mit | nums = # complete
s = # complete
# complete
"""
Explanation: This Laptop Is Inadequate:
An Aperitif for DSFP Session 8
Version 0.1
By AA Miller 2019 Mar 24
When I think about LSST there are a few numbers that always stick in my head:
37 billion (the total number of sources that will be detected by LSST)
10 (the numb... |
ML4DS/ML4all | C3.Classification_LogReg/.ipynb_checkpoints/RegresionLogistica_student-checkpoint.ipynb | mit | # To visualize plots in the notebook
%matplotlib inline
# Imported libraries
import csv
import random
import matplotlib
import matplotlib.pyplot as plt
import pylab
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from sklearn.preprocessing import PolynomialFeatures
from sklearn import linear_model
"""
Ex... |
pycroscopy/pycroscopy | jupyter_notebooks/AFM_simulations/Multifrequency_Viscoelasticity/Simulation_SoftMatter.ipynb | mit | import sys
sys.path.append('d:\Github\pycroscopy')
from __future__ import division, absolute_import, print_function
from pycroscopy.simulation.afm_lib import dynamic_spectroscopy
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
"""
Explanation: Dynamic atomic force microscopy s... |
Nikolay-Lysenko/presentations | endogeneity/treatment_effect_with_selection_on_unobservables.ipynb | mit | from itertools import combinations
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
from sklearn.model_selection import train_test_split, KFold, GridSearchCV
from sklearn.metrics import r2_score
from sklearn.linear_model import LinearRegression
# Startup settings can not suppress a warning from... |
AllenDowney/ModSimPy | notebooks/chap01.ipynb | mit | try:
import pint
except ImportError:
!pip install pint
import pint
try:
from modsim import *
except ImportError:
!pip install modsimpy
from modsim import *
"""
Explanation: Modeling and Simulation in Python
Chapter 1
Copyright 2020 Allen Downey
License: Creative Commons Attribution 4.0 Interna... |
janfreyberg/niwidgets | report.ipynb | cc0-1.0 | from niwidgets import NiWidget
"""
Explanation: Niwidgets: interactive visualisation of neuroimaging data
Abstract
With a new python package, niwidgets, we attempt to make it easier to interactively visualise neuroimaging data in jupyter notebooks. Interactive visualisations are useful both for the research process, a... |
JuanIgnacioGil/basket-stats | sentiment_analysis/sentiment_analysis.ipynb | mit | %load_ext autoreload
%autoreload 2
import data_collection
import data_cleaning as dcl
import sentiment_analysis as sent
api = data_collection.login_into_twitter()
players = [
'Giannis Antetokounmpo',
'James Harden',
'Rudy Gobert',
'Paul George',
'Kevin Durant',
'Anthony Davis',
'Damian Li... |
AlexGascon/playing-with-keras | #3 - Improving text generation/3.2 - Increasing dataset size.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
"""
Explanation: 3.2. Increasing dataset size
The next thing ... |
petspats/pyhacores | under_construction/fsk_modulator/doc.ipynb | apache-2.0 | samples_per_symbol = 64 # this is so high to make stuff plottable
symbols = [1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0]
data = []
for x in symbols:
data.extend([1 if x else -1] * samples_per_symbol)
plt.plot(data)
plt.title('Data to send')
plt.show()
"""
Ex... |
ctenix/pytheway | MachineL/notes/ML13-监督学习-基本分类模型.ipynb | gpl-3.0 | X=[[0],[1],[2],[3]]
y=[0,0,1,1]
from sklearn.neighbors import KNeighborsClassifier
neigh = KNeighborsClassifier(n_neighbors=3)
neigh.fit(X,y)
"""
Explanation: ML13——监督学习
基本分类模型
K近邻分类器
创建一组数据X和它对应的标签y
End of explanation
"""
print(neigh.predict([[1.1]]))
"""
Explanation: 调用predict()函数,对未知样本[1.1]进行分类
End of explana... |
mne-tools/mne-tools.github.io | dev/_downloads/1537c1215a3e40187a4513e0b5f1d03d/eeg_csd.ipynb | bsd-3-clause | # Authors: Alex Rockhill <aprockhill@mailbox.org>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
Explanation: Transform EEG data using current source density (CSD)
This script shows an example... |
salman-jpg/maya | stemming_and_transliteration/Bangla Stemming and Transliteration.ipynb | mit | from indicnlp.morph import unsupervised_morph
morph = unsupervised_morph.UnsupervisedMorphAnalyzer("bn")
text = u"""\
করা করেছিলাম করেছি করতে করেছিল হয়েছে হয়েছিল হয় হওয়ার হবে আবিষ্কৃত আবিষ্কার অভিষিক্ত অভিষেক অভিষেকের আমি আমার আমাদের তুমি তোমার তোমাদের বসা বসেছিল বসে বসি বসেছিলাম বস বসার\
"""
word_token = text.spli... |
diazmazzaro/UC2K17_DEV | demos/05_jupyter/Move+existing+user+content+to+a+new+user.ipynb | gpl-3.0 | from arcgis.gis import *
"""
Explanation: Mover contenido de un usuario existente a otro nuevo
End of explanation
"""
gis = GIS("https://ags-enterprise4.aeroterra.com/arcgis/", "PythonApi", "test123456", verify_cert=False)
"""
Explanation: Cree una conexión con el portal.
End of explanation
"""
orig_userid = "afe... |
mayank-johri/LearnSeleniumUsingPython | Section 2 - Advance Python/Chapter S2.02 - XML/Chapter 8 - Parsing XML.ipynb | gpl-3.0 | import xml.etree.ElementTree as ET
"""
Explanation: XML
In Core Python, we discussed about text files. In this chapter, we will discuss about XML.
What is XML
Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-re... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/ukesm1-0-ll/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'ukesm1-0-ll', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: MOHC
Source ID: UKESM1-0-LL
Topic: Ocnbgchem
Sub-Topics: Tracers.
Propert... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.