repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
jdsanch1/SimRC | 02. Parte 2/13. Clase 13/.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... |
google-aai/tf-serving-k8s-tutorial | jupyter/resnet_model_understanding.ipynb | apache-2.0 | import csv
import io
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
import requests
import tensorflow as tf
from io import BytesIO
from PIL import Image
from subprocess import call
"""
Explanation: Understanding Resnet Model Features
We know that the Resnet model works well, but why does i... |
ES-DOC/esdoc-jupyterhub | notebooks/mri/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', 'mri', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: MRI
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbulen... |
hypergravity/cham_hates_python | notebook/cham_hates_python_02_basic_syntax.ipynb | mit | object
dir()
In
a = 1.5
type(a)
print isinstance(a, float)
print isinstance(a, object)
"""
Explanation: <img src="https://www.python.org/static/img/python-logo.png">
Welcome to my lessons
Bo Zhang (NAOC, bozhang@nao.cas.cn) will have... |
miaecle/deepchem | examples/tutorials/11_Learning_Unsupervised_Embeddings_for_Molecules.ipynb | mit | %tensorflow_version 1.x
!curl -Lo deepchem_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import deepchem_installer
%time deepchem_installer.install(version='2.3.0')
"""
Explanation: Tutorial Part 11: Learning Unsupervised Embeddings for Molecules
In this example, we w... |
PMEAL/OpenPNM | examples/reference/uncategorized/managing_geometrical_properties_of_imported_networks.ipynb | mit | import numpy as np
import openpnm as op
import matplotlib.pyplot as plt
ws = op.Workspace()
ws.settings['loglevel'] = 50 # Supress warnings, but see error messages
"""
Explanation: Geometry of Imported Networks
The Imported geometry class is used to store the geometrical properties of imported networks. When importi... |
esa-as/2016-ml-contest | SHandPR/RandomForest.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
from sklearn.ensemble import RandomForestClassifier
from pandas import set_option
set_option("display.max_rows", 1... |
xlbaojun/Note-jupyter | 05其他/pandas文档-zh-master/与SQL对比-Comparison with SQL.ipynb | gpl-2.0 | import pandas as pd
import numpy as np
url = 'https://raw.github.com/pydata/pandas/master/pandas/tests/data/tips.csv'
tips = pd.read_csv(url)
tips.head()
"""
Explanation: 与SQL的比较
由于许多潜在pandas用户已经熟悉SQL,这个页面旨在使用pandas给出SQL各种操作的例子。
如果你对pandas比较陌生,你可能需要通过10分钟先读一下pandas。
按照惯例,我们先导入pandas和numpy:
End of explanation
"""
t... |
patrickmineault/xcorr-snippets | decision-making/.ipynb_checkpoints/Multi-armed bandit as a Markov decision process-checkpoint.ipynb | mit | import itertools
import numpy as np
from pprint import pprint
def sorted_values(dict_):
return [dict_[x] for x in sorted(dict_)]
def solve_bmab_value_iteration(N_arms, M_trials, gamma=1,
max_iter=10, conv_crit = .01):
util = {}
# Initialize every state to utility 0.
... |
bmeaut/python_nlp_2017_fall | course_material/04_Generator_expressions_list_comprehension/04_Generator_expressions_list_comprehension_lecture.ipynb | mit | l = []
for i in range(10):
l.append(2*i+1)
l
"""
Explanation: Introduction to Python and Natural Language Technologies
Lecture 04, Week 04
February 28, 2018
List comprehension
transform any iterable into a list in one line
syntactic sugar
example: create a list of the first N odd numbers starting from 1
End of ex... |
FishingOnATree/deep-learning | gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
tensorflow/tpu | tools/colab/shakespeare_with_tpuestimator.ipynb | apache-2.0 | # Copyright 2018 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... |
andreyf/machine-learning-examples | numpy_and_pandas/practice_pandas_titanic.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
%matplotlib inline
from matplotlib import pyplot as plt
pd.set_option("display.precision", 2)
"""
Explanation: <center>
<img src="../img/ods_stickers.jpg">
Открытый курс по машинному обучению. Сессия № 2
</center>
Автор материала: программист-исследователь Mail.ru Group, старший ... |
pombredanne/pythran | docs/examples/Third Party Libraries.ipynb | bsd-3-clause | import pythran
%load_ext pythran.magic
%%pythran
#pythran export pythran_cbrt(float64(float64), float64)
def pythran_cbrt(libm_cbrt, val):
return libm_cbrt(val)
"""
Explanation: Using third-party Native Libraries
Sometimes, the functionnality you need are onmy available in third-party native libraries. There's ... |
machinelearningdeveloper/lc101-kc | November 14, 2016/Covered in class.ipynb | unlicense | # Below are two ways to get the last character in a string
# Also known as getting the last letter in a word
# 012345678
fruit = 'cranberry'
# Long way
number_of_characters_in_fruit = len(fruit)
last_item_location = number_of_characters_in_fruit - 1
lastch = fruit[last_item_location]
print('Number of character... |
EBIvariation/eva-cttv-pipeline | data-exploration/complex-events/notebooks/detailed-hgvs-stats.ipynb | apache-2.0 | import os
import re
import sys
import numpy as np
from eva_cttv_pipeline.clinvar_xml_utils import *
from eva_cttv_pipeline.clinvar_identifier_parsing import *
%matplotlib inline
import matplotlib.pyplot as plt
PROJECT_ROOT = '/home/april/projects/opentargets/complex-events'
# dump of all records with no functional... |
necromuralist/necromuralist.github.io | posts/plot_cv_vs_c_value.ipynb | mit | import matplotlib.pyplot as plot
import seaborn
from sklearn import datasets
from sklearn import svm
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
%matplotlib inline
"""
Explanation: SVC Cross Validtion Scores vs C-value
The goal here is to visualize the effect of the C... |
mdeff/ntds_2016 | project/reports/youtube_fame/Data_exploration.ipynb | mit | import requests
import json
from math import *
import numpy as np
import pandas as pd
#import tensorflow as tf
import time
import collections
import os
import timeit
%matplotlib inline
import matplotlib.pyplot as plt
# load the database
from IPython.display import display
folder = os.path.join('videos_data_random',... |
astarostin/MachineLearningSpecializationCoursera | course3/week2/PCA.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.patches as mpatches
matplotlib.style.use('ggplot')
%matplotlib inline
"""
Explanation: Метод главных компонент
В данном задании вам будет предложено ознакомиться с подходом, который переоткрывался в самых ра... |
googledatalab/notebooks | samples/ML Toolbox/Regression/Census/3 Service Train.ipynb | apache-2.0 | import google.datalab as datalab
import google.datalab.ml as ml
import mltoolbox.regression.dnn as regression
import os
import time
"""
Explanation: Training with Cloud Machine Learning Engine
This notebook is the second of a set of steps to run machine learning on the cloud. In this step, we will use the data and ass... |
alephcero/adsProject | olds/DataAnalysis.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
"""
Explanation: Referencia: http://dump.jazzido.com/CNPHV2010-RADIO/
Variables en el CENSO 2010 (INDEC)
VIVIENDA.INCALCONS Calidad constructiva de la vivienda
VIVIENDA.INCALSERV Calidad... |
project-chip/connectedhomeip | docs/guides/repl/Matter - REPL Intro.ipynb | apache-2.0 | import chip.native
import pkgutil
module = pkgutil.get_loader('chip.ChipReplStartup')
%run {module.path}
"""
Explanation: REPL Basics
<a href="http://35.236.121.59/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fproject-chip%2Fconnectedhomeip&urlpath=lab%2Ftree%2Fconnectedhomeip%2Fdocs%2Fguides%2Frepl%2FMat... |
gem-pasteur/Macsyfinder_models | models/Conjugation/Tutorial_ICE.ipynb | gpl-3.0 | mkdir Sequences
mkdir Sequences/Replicon
"""
Explanation: Pipeline to delimit ICE
In this notebook, we'll find ICE and delimit them in the Haemophilus influenzae species
First we'll get the complete genome from NCBI
We'll build the core genome
We'll detect the conjugative system in the genomes
We'll identify the cor... |
ITAM-DS/analisis-numerico-computo-cientifico | libro_optimizacion/temas/1.computo_cientifico/1.7/Integracion_numerica.ipynb | apache-2.0 | import math
import numpy as np
import pandas as pd
from scipy.integrate import quad
import matplotlib.pyplot as plt
f=lambda x: np.exp(-x**2)
x=np.arange(-1,1,.01)
plt.plot(x,f(x))
plt.title('f(x)=exp(-x^2)')
plt.show()
"""
Explanation: (IN)=
1.7 Integración Numérica
```{admonition} Notas para contenedor de docker:... |
SheffieldML/GPyOpt | manual/GPyOpt_entropy_search.ipynb | bsd-3-clause | import numpy as np
import GPy
import GPyOpt
from GPyOpt.models.gpmodel import GPModel
from GPyOpt.core.task.space import Design_space, bounds_to_space
from GPyOpt.util.mcmc_sampler import AffineInvariantEnsembleSampler
from GPyOpt.acquisitions.ES import AcquisitionEntropySearch
from GPyOpt.acquisitions.EI import Acquis... |
steinam/teacher | jup_notebooks/datenbanken/Uebungen_Celko.ipynb | mit | %load_ext sql
%sql mysql://steinam:steinam@localhost/celko
%%sql
select * from Register;
"""
Explanation: Übungen zu SQL
Teacher
Wir möchten eine Abfrage erstellen, die einem Programm die Namen aller Lehrer für jeden Kurs und jeden Schüler übergibt.
Im späteren Ausdruck gibt es im Formular allerdings nur Platz für ... |
fonnesbeck/ngcm_pandas_2016 | notebooks/2.4 - Data Analysis with Pandas and Scikit-learn.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
from scipy.optimize import fmin
data = pd.DataFrame({'x':np.array([2.2, 4.3, 5.1, 5.8, 6.4, 8.0]),
'y':np.array([0.4, 10.1, 14.0, 10.9, 15.4, 18.5])})
data.plot.scatter('x', 'y'... |
planet-os/notebooks | api-examples/ndbc-wavewatch-iii.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import dateutil.parser
import datetime
from urllib.request import urlopen, Request
import simplejson as json
from datetime import date, timedelta, datetime
import matplotlib.dates as mdates
from mpl_toolkits.basemap import Basemap
"""
Explanation: N... |
tensorflow/docs-l10n | site/ko/guide/keras/custom_callback.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... |
tzipperle/mplstyle | examples/notebook_overview.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
"""
Explanation: Example of using the mplstyle package
With the package you have the following possibilities to define your style:
plt_style: Set the formattingn; default: default
color_style: Set the c... |
takahish/deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
google-research/bigbird | bigbird/summarization/eval.ipynb | apache-2.0 | # Copyright 2020 The BigBird 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 applicable... |
awsdocs/aws-doc-sdk-examples | python/cross_service/textract_comprehend_notebook/TextractAndComprehendNotebook.ipynb | apache-2.0 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import getpass
access_key = getpass.getpass()
secret_key = getpass.getpass()
"""
Explanation: This cross-service notebook walks you through the process of using Amazon Textract's DetectDocumentText API to extrac... |
martinggww/lucasenlights | MachineLearning/DataScience-Python3/SimilarMovies.ipynb | cc0-1.0 | 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='|',... |
astroai/starnet | 6_Error_Propagation.ipynb | bsd-2-clause | import numpy as np
from keras.models import load_model
import h5py
import tensorflow as tf
import time
import keras.backend as K
import subprocess
datadir= ""
"""
Explanation: Propogate Errors
This notebook takes you through the steps of how to propogate errors for through the neural network model
required packages... |
lab3000/deeplearngene | demos/lab3000_n1e1p1b2 - deeplearngene demo2.ipynb | gpl-3.0 | n1e1p1b2_clade.current_generation
"""
Explanation: Initially the output folder is empty
Generations are 0-indexed
Generation0
End of explanation
"""
n1e1p1b2_clade.spawn()
n1e1p1b2_clade.genotypes
"""
Explanation: spawn() creates a pandas dataframe of genes which 'encode' the model architectures of a given po... |
gfeiden/Notebook | Projects/ngc2516_spots/cmd_age_composition.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Color-Magnitude Diagrams of NGC 2516
Determining the age and chemical composition of NGC 2516 through color-magnitude diagram (CMD) fitting.
End of explanation
"""
ngc2516 = np.genfromtxt('data/jeff_2001.tsv', delimiter=';', comme... |
srcole/qwm | misc/shape value_locked_by_trial.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('white')
from misshapen import shape, nonshape
"""
Explanation: Hey Yimeng!
So I'm finding it hard to explain how to make a time series of a sha... |
ES-DOC/esdoc-jupyterhub | notebooks/ipsl/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', 'ipsl', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: IPSL
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
NathanYee/ThinkBayes2 | code/chap02mine.ipynb | gpl-2.0 | % matplotlib inline
from thinkbayes2 import Hist, Pmf, Suite
"""
Explanation: Think Bayes: Chapter 2
This notebook presents example code and exercise solutions for Think Bayes.
Copyright 2016 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
End of explanation
"""
pmf = Pmf()
for x in [1,2,3,4,5,6]:
... |
graphistry/pygraphistry | demos/for_analysis.ipynb | bsd-3-clause | import graphistry
# To specify Graphistry account & server, use:
# graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com')
# For more options, see https://github.com/graphistry/pygraphistry#configure
"""
Explanation: Tutorial: Data Analysis in Graphistry
Register
Lo... |
tpin3694/tpin3694.github.io | python/try_except_finally.ipynb | mit | # Create some data
scores = [23,453,54,235,74,234]
"""
Explanation: Title: Try, Except, and Finally
Slug: try_except_finally
Summary: Try, Except, and Finally
Date: 2016-05-01 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
Create data
End of explanation
"""
# Try to:
try:
# Add a list of integers and... |
palrogg/foundations-homework | 07/Homework7.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_csv("07-hw-animals.csv")
df.columns
df.head(3)
df.sort_values(by='length', ascending=False).head(3)
df['animal'].value_counts()
dogs = df[df['animal']=='dog']
dogs
df[df['length'] > 40]
df['inches'] = .393701 * df['length']
df
... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/sandbox-2/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-2', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: SANDBOX-2
Topic: Land
Sub-Topics: Soil, Snow, Vegetati... |
Danghor/Algorithms | Python/Chapter-06/2-3-Trees-Visualization.ipynb | gpl-2.0 | import graphviz as gv
"""
Explanation: 2-3 Trees
This notebook contains the code to visualize 2-3 trees.
End of explanation
"""
class TwoThreeTree:
sNodeCount = 0
def __init__(self):
TwoThreeTree.sNodeCount += 1
self.mID = TwoThreeTree.sNodeCount
def getID(self):
ret... |
Cyb3rWard0g/ThreatHunter-Playbook | docs/notebooks/windows/08_lateral_movement/WIN-190815181010.ipynb | gpl-3.0 | from openhunt.mordorutils import *
spark = get_spark()
"""
Explanation: Remote Service creation
Metadata
| | |
|:------------------|:---|
| collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] |
| creation date | 2019/08/15 |
| modification date | 2020/09/20 |
| playbook related | ['WIN-19081... |
spencer2211/deep-learning | autoencoder/Convolutional_Autoencoder_Solution.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[2]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
zzsza/Datascience_School | 03. 파이썬 프로그래밍/07. 파이썬의 자료형.ipynb | mit | from sys import getsizeof
a = 1
getsizeof(a)
b = "1"
getsizeof(b)
"""
Explanation: 파이썬의 자료형
자료형
지금까지 우리는 변수에 숫자, 문자열, 리스트 등의 값을 마음대로 넣어서 사용해 왔다. 그러나 프로그램이 실행되려면 컴퓨터는 각 변수에 어떤 종류의 값이 들어가 있는지 알아야 한다. 값을 저장하는 방식이나 계산하는 방법이 다르기 때문이다.
이러한 값의 종류를 자료형(data type) 혹은 단순히 타입(type)이라고 한다.
예를 들어 정수인 1과 문자열인 "1"이 컴퓨터에 저장될 때 어느 정... |
tensorflow/neural-structured-learning | g3doc/tutorials/graph_keras_mlp_cora.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 u... |
whitead/numerical_stats | unit_5/hw_2017/problem_set_3.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
x = np.arange(1,21)
for p in [0.05, 0.1, 0.25]:
y = p*(1 - p)**(x - 1)
plt.plot(x, y, label='$p = {}$'.format(p), marker='.')
plt.xlabel('$n$')
plt.ylabel('$P(n)$')
plt.xlim(1,20)
plt.legend()
plt.show()
"""
Explanation: Answer the fol... |
t-davidson/hate-speech-and-offensive-language | src/Automated Hate Speech Detection and the Problem of Offensive Language.ipynb | mit | import pandas as pd
import numpy as np
import pickle
import sys
from sklearn.feature_extraction.text import TfidfVectorizer
import nltk
from nltk.stem.porter import *
import string
import re
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer as VS
from textstat.textstat import *
from sklearn.linear_mo... |
sdpython/pyquickhelper | _doc/notebooks/example_pyquickhelper.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu(header="Plan")
"""
Explanation: example pyquickhelper
Explore a folder, run a command line from a notebook.
End of explanation
"""
from pyquickhelper.loghelper import fLOG
fLOG(OutputPrint=False) # by default
fLOG("not printed")
fLOG(OutputPrint=True)
fL... |
david4096/bioapi-examples | python_notebooks/1kg_reference_service.ipynb | apache-2.0 | from ga4gh.client import client
c = client.HttpClient("http://1kgenomes.ga4gh.org")
"""
Explanation: GA4GH 1000 Genomes Reference Service Example
This example illustrates how to access the available reference sequences offered by a GA4GH instance.
Initialize the client
In this step we create a client object which wil... |
nathanielng/machine-learning | perceptron/linearregression.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import multiprocessing as mp
import itertools
import numpy as np
import matplotlib.pyplot as plt
np.set_printoptions(edgeitems=3,infstr='inf',linewidth=75,nanstr='nan',pr... |
Naereen/notebooks | Floating_point_error_propagation_in_polynomial_multiplication_with_Fast-Fourier_Transform.ipynb | mit | import numpy as np
np.version.full_version
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Floating-point-error-propagation-in-polynomial-multiplication-with-Fast-Fourier-Transform" data-toc-modified-id="Floating-point-error-propagation-in-polynomial-multiplication-with-Fast-Fourier-Transfor... |
GSimas/EEL7045 | Aula 8 - Teorema de Norton.ipynb | mit | print("Exemplo 4.11")
#Superposicao
#Analise Fonte de Tensao
#Req1 = 4 + 8 + 8 = 20
#i1 = 12/20 = 3/5 A
#Analise Fonte de Corrente
#i2 = 2*4/(4 + 8 + 8) = 8/20 = 2/5 A
#in = i1 + i2 = 1A
In = 1
#Req2 = paralelo entre Req 1 e 5
#20*5/(20 + 5) = 100/25 = 4
Rn = 4
print("Corrente In:",In,"A")
print("Resistência Rn... |
PyDataMadrid2016/Conference-Info | workshops_materials/20160408_0900_Basic_Python_Packages_for_Science/Basic Python Packages for Science.ipynb | mit | from IPython.display import HTML
HTML('<iframe src="http://conda.pydata.org/docs/_downloads/conda-cheatsheet.pdf" width="700" height="400"></iframe>')
"""
Explanation: Basic Python Packages for Science
The Aeropython’s guide to the Python Galaxy!
Siro Moreno Martín
Alejandro Sáez Mollejo
0. Introduction
Python in the... |
llclave/Springboard-Mini-Projects | Reduce Hospital Readmissions Using EDA/sliderule_dsi_inferential_statistics_exercise_3.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import bokeh.plotting as bkp
from mpl_toolkits.axes_grid1 import make_axes_locatable
# read in readmissions data provided
hospital_read_df = pd.read_csv('data/cms_hospital_readmissions.csv')
"""
Explanation: Hospital Readmissio... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_receptive_field_mtrf.ipynb | bsd-3-clause | # Authors: Chris Holdgraf <choldgraf@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Nicolas Barascud <nicolas.barascud@ens.fr>
#
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 3
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from os.path import jo... |
bgroveben/python3_machine_learning_projects | oreilly_GANs_for_beginners/oreilly_GANs_for_beginners/oreilly_GANs_for_beginners/gan-notebook.ipynb | mit | import tensorflow as tf
import numpy as np
import datetime
import matplotlib.pyplot as plt
%matplotlib inline
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/")
"""
Explanation: Generative Adversarial Networks for Beginners
Build a neural network that learns to... |
3upperm2n/notes-deeplearning | tensorboard/tensorboard/Anna KaRNNa Summaries.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... |
karenlmasters/ComputationalPhysicsUnit | IntroductiontoPython/Introduction to Python Notes.ipynb | apache-2.0 | print("Hello World")
"""
Explanation: Python Notes
My notes from working through Chapter 2 of Newman's Computational Physics
End of explanation
"""
x=1
print(x)
"""
Explanation: Variable Types
End of explanation
"""
x=1.5
print(x)
x=float(1)
print(x)
x=complex(1.5)
print(x)
x="This is a string"
print(x)
"""
Ex... |
landlab/landlab | notebooks/tutorials/mappers/mappers.ipynb | mit | from landlab import RasterModelGrid
import numpy as np
mg = RasterModelGrid((3, 4), xy_spacing=100.0)
h = mg.add_zeros("surface_water__depth", at="node")
h[:] = 7 - np.abs(6 - np.arange(12))
"""
Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../landlab_header.png"></a>
Mapping values... |
intel-analytics/BigDL | python/serving/example/keras-to-cluster-serving-example.ipynb | apache-2.0 | import tensorflow as tf
import os
import PIL
tf.__version__
# Obtain data from url:"https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip"
zip_file = tf.keras.utils.get_file(origin="https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip",
fname="... |
harpolea/pyro2 | multigrid/multigrid-examples.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
from __future__ import print_function
import numpy as np
import mesh.boundary as bnd
import mesh.patch as patch
import multigrid.MG as MG
"""
Explanation: Multigrid examples
End of explanation
"""
nx = ny = 256
mg = MG.CellCenterMG2d(nx, ny,
... |
explosion/thinc | examples/03_textcat_basic_neural_bow.ipynb | mit | !pip install thinc syntok "ml_datasets>=0.2.0" tqdm
"""
Explanation: Basic neural bag-of-words text classifier with Thinc
This notebook shows how to implement a simple neural text classification model in Thinc. Last tested with thinc==8.0.13.
End of explanation
"""
from syntok.tokenizer import Tokenizer
def tokeniz... |
Kaggle/learntools | notebooks/feature_engineering_new/raw/tut6.ipynb | apache-2.0 | #$HIDE_INPUT$
import pandas as pd
autos = pd.read_csv("../input/fe-course-data/autos.csv")
"""
Explanation: Introduction
Most of the techniques we've seen in this course have been for numerical features. The technique we'll look at in this lesson, target encoding, is instead meant for categorical features. It's a met... |
dsacademybr/PythonFundamentos | Cap09/Notebooks/DSA-Python-Cap09-Exercicio-Solucao.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 9</font>
Download: http://github.com/dsacademybr
End of explanation
"""
# Impor... |
jmhsi/justin_tinker | data_science/courses/temp/courses/dl1/lesson2-image_models.ipynb | apache-2.0 | %reload_ext autoreload
%autoreload 2
%matplotlib inline
from fastai.conv_learner import *
PATH = 'data/planet/'
# Data preparation steps if you are using Crestle:
os.makedirs('data/planet/models', exist_ok=True)
os.makedirs('/cache/planet/tmp', exist_ok=True)
!ln -s /datasets/kaggle/planet-understanding-the-amazon... |
CompPhysics/MachineLearning | doc/pub/week43/ipynb/week43.ipynb | cc0-1.0 | %matplotlib inline
# Start importing packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
from tensorflow.keras.layers import Input
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.layer... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/sandbox-1/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-1', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: SANDBOX-1
Topic: Atmoschem
Sub-Top... |
klavinslab/coral | docs/tutorial/design/design_primers.ipynb | mit | import coral as cor
"""
Explanation: Primer Design
One of the first things anyone learns in a molecular biology lab is how to design primers. The exact strategies vary a lot and are sometimes polymerase-specific. coral uses the Klavins' lab approach of targeting a specific melting temperature (Tm) and nothing else, wi... |
scikit-learn-contrib/hdbscan | notebooks/Looking at cluster consistency.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import hdbscan
from scipy.spatial.distance import cdist
#Some plotting libraries
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib notebook
sns.set_context('poster')
sns.set_color_codes()
plot_kwds = {'alpha' : 0.25, 's' : 40, 'linewidths':0}
data = np.load('clus... |
lago-project/lago | docs/examples/lago_sdk_one_vm_one_net.ipynb | gpl-2.0 | import logging
import tempfile
from textwrap import dedent
from lago import sdk
"""
Explanation: Lago SDK Example - one VM one Network
End of explanation
"""
with tempfile.NamedTemporaryFile(delete=False) as init_file:
init_file.write(dedent("""
domains:
vm-01:
memory: 1024
nics:
... |
DJCordhose/ai | notebooks/workshops/tss/workshop.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
from distutils.version import StrictVersion
import sklearn
print(sklearn.__version__)
assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1')
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.... |
Olsthoorn/TransientGroundwaterFlow | Syllabus_in_notebooks/Sec5_6_symmetric-solution_sudden_change.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erfc
"""
Explanation: Section 5.6. Symmetric solution of a decaying head in strip of land
IHE, Delft, 2019-01-02
@T.N.Olsthoorn, 2019-01-02
A solution, which shows the deline of the head in a strip due to bleeding to the fixed heads at both e... |
mairas/delta_calibration | delta_calibration.ipynb | mit | from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import leastsq, minimize
%matplotlib inline
"""
Explanation: Delta printer geometry calibration using bed auto-level... |
mattmcd/PyAnalysis | scripts/love_actually/Data_Actually.ipynb | apache-2.0 | from __future__ import division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
from scipy.cluster.hierarchy import dendrogram, linkage
import ggplot as gg
import networkx as nx
%matplotlib inline
"""
Explanation: Data Actually
David Robinson posted a great article Analyzing networks ... |
paulcon/active_subspaces | tutorials/basic.ipynb | mit | %matplotlib inline
import active_subspaces as ac
import numpy as np
import matplotlib.pyplot as plt
from wing_functions import *
"""
Explanation: Active Subspaces Tutorial
In this tutorial, we'll show you how to utilize active subspaces for dimension reduction with the Python Active-Subspaces Utility Library. We'll de... |
arnoldlu/lisa | ipynb/examples/trace_analysis/TraceAnalysis_FunctionsProfiling.ipynb | apache-2.0 | import logging
from conf import LisaLogging
LisaLogging.setup()
"""
Explanation: Trace Analysis Examples
Kernel Functions Profiling
Details on functions profiling are given in Plot Functions Profiling Data below.
End of explanation
"""
# Generate plots inline
%matplotlib inline
import json
import os
# Support to a... |
wangyu16/Introduction-to-Polymer-Science | ATRP_Kinetic_Simulator_Moments.ipynb | cc0-1.0 | %%capture
import sys
if not 'chempy' in sys.modules:
!pip install chempy
from chempy import ReactionSystem, Substance
from chempy.kinetics.ode import get_odesys
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 12}) # Feel free to change the fo... |
OpenWeavers/openanalysis | doc/Libraries/1 - Introduction to array manipulation with numpy.ipynb | gpl-3.0 | import numpy as np
"""
Explanation: Need for a faster array
We know how lists work in Python. We also know that lists can hold the data items of various data types. This means that the list storage allocated to elements can vary in size. This factor makes the list access slow, and operations on array could take long t... |
DistrictDataLabs/yellowbrick | examples/rebeccabilbro/cvscores_experimentation.ipynb | apache-2.0 | import pandas as pd
import matplotlib.pyplot as plt
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection import StratifiedKFold
from yellowbrick.model_selection import CVScores
import os
from yellowbrick.download import download_all
## The path to the test data sets
FIXTURES = os.path.join(o... |
Kuwamai/probrobo_note | monte_calro_localization/notebook_demo.ipynb | mit | %matplotlib inline
import numpy as np
import math, random # 計算用、乱数の生成用ライブラリ
import matplotlib.pyplot as plt # 描画用ライブラリ
class Landmarks:
def __init__(self, array):
self.positions = array # array = [[1個めの星のx座標, 1個めの星のy座標], [2個めの星のx座標, 2個めの星のy座標]...]
def draw(self):
# ランドマークの位... |
m2dsupsdlclass/lectures-labs | labs/08_frameworks/Minimal_MLP__stochastic_optimization_landscape.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from torch.nn import Parameter
from torch.nn.functional import mse_loss
from torch.autograd import Variable
from torch.nn.functional import relu
"""
Explanation: Stochastic optimization landscape of a minimal MLP
In this notebook, we... |
maojrs/riemann_book | Euler_approximate.ipynb | bsd-3-clause | %matplotlib inline
%config InlineBackend.figure_format = 'svg'
import numpy as np
from exact_solvers import euler
from utils import riemann_tools as rt
from ipywidgets import interact
from ipywidgets import widgets
State = euler.Primitive_State
def roe_averages(q_l, q_r, gamma=1.4):
rho_sqrt_l = np.sqrt(q_l[0])
... |
mne-tools/mne-tools.github.io | 0.24/_downloads/5ac2a3ff8baa6aba4bf6dd1d047703e2/spm_faces_dataset_sgskip.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD-3-Clause
import matplotlib.pyplot as plt
import mne
from mne.datasets import spm_face
from mne.preprocessing import ICA, create_eog_epochs
from mne import io, combine_evoked
from mne.minim... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session04/Day4/1. HBM Truncated Gaussian Population Model.ipynb | mit | import numpy as np
import scipy.stats as stats
import pandas as pd
import matplotlib.pyplot as plt
import pyjags
import pystan
import pickle
import triangle_linear
from IPython.display import display, Math, Latex
from __future__ import division, print_function
from pandas.tools.plotting import *
from matplotlib import... |
AllenDowney/CompStats | text_analysis.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Text analysis with Python
Copyright 2019 Allen Downey
MIT License
End of explanation
"""
def iterate_words(filename):
"""Read lines from a file and split them into words."""
for line in open(filename):
for word in line.split():
... |
jakob-bauer/partialflow | Sanity-Check.ipynb | mit | import tensorflow as tf
import numpy as np
# load MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
train_images = np.reshape(mnist.train.images, [-1, 28, 28, 1])
train_labels = mnist.train.labels
test_images = np.reshape(mnist.test.... |
Salman-H/bike-sharing-network | Your_first_neural_network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
tensorflow/workshops | extras/eager/eager-tutorial-simone.ipynb | apache-2.0 | import tensorflow as tf
a = tf.constant(3.0)
b = a + 2.0
print(b)
"""
Explanation: This notebook introduces the eager execution for TensorFlow, a low-level interface allowing a more dynamic programming experience. Eager execution greatly simplifies how you can write and debug models, softening the complete separation ... |
yuanagain/seniorthesis | src/2017-03-27.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
"""
Explanation: 2017-03-27
End of explanation
"""
res = 0.01
dt = res
"""
Explanation: Nonrigorous Simulation
We first establish a working resolution
End of explanation
"""
default_lambda_1, default_lambda_2, d... |
google/trax | trax/models/reformer/machine_translation.ipynb | apache-2.0 | # 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 the Licen... |
IanHawke/Southampton-PV-NumericalMethods-2016 | solutions/02-Initial-Value-Problems.ipynb | mit | from __future__ import division
import numpy
%matplotlib notebook
from matplotlib import pyplot
parameters = { "T_ambient" : 290.0,
"c1" : 1.0e-5,
"c2" : 0.9,
"c3" : 0.0,
"c4" : 1.0e-2,
"c5" : 1.0}
T_initial = 300.0
t_end = 1e-2
def f(t, T, pa... |
c22n/ion-channel-ABC | docs/examples/human-atrial/courtemanche_ical_unified.ipynb | gpl-3.0 | import os, tempfile
import logging
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from ionchannelABC import theoretical_population_size
from ionchannelABC import IonChannelDistance, EfficientMultivariateNormalTransition, IonChannelAcceptor
from ionchannelABC.experimen... |
texib/deeplearning_homework | tensor-flow-exercises/5_word2vec.ipynb | mit | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
import collections
import math
import numpy as np
import os
import random
import tensorflow as tf
import urllib
import zipfile
from matplotlib import pylab
from sklearn.manifold import TSNE
"""
Explanation: Dee... |
bowen0701/data_science | notebook/mse_mle_bayes.ipynb | bsd-2-clause | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import itertools
import numpy as np
import scipy as sp
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
def get_prob_seq():
"""Generate a sequence of numbers in ... |
GoogleCloudPlatform/nvidia-merlin-on-vertex-ai | 04-e2e-pipeline.ipynb | apache-2.0 | import os
import json
from datetime import datetime
from google.cloud import aiplatform as vertex_ai
from kfp.v2 import compiler
"""
Explanation: End-to-end Recommender System with NVIDIA Merlin and Vertex AI.
This notebook shows how to deploy and execute an end-to-end recommender system on Vertex Pipelines using NVID... |
dsacademybr/PythonFundamentos | Cap04/Notebooks/DSA-Python-Cap04-03-Modulos-e-Pacotes.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 4</font>
Download: http://github.com/dsacademybr
End of explanation
"""
# Impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.