repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
essicolo/ecologie-mathematique | 02_Python/2.ipynb | mit | 2+2
67.1-43.3
2*4
2**4
1/2
1 / 2 # les espaces ne signifie rien ici
"""
Explanation: Chapitre 2 : Python
Le python est une famille de reptile avec pas de pattes comprenant 10 espèces. Mais Python est un langage de programmation lancé en 1991 par Guido van Rossum, un fan du groupe d'humoriste britanique Mounty Pyt... |
synthicity/activitysim | activitysim/examples/example_estimation/notebooks/04_auto_ownership.ipynb | agpl-3.0 | import os
import larch # !conda install larch -c conda-forge # for estimation
import pandas as pd
"""
Explanation: Estimating Auto Ownership
This notebook illustrates how to re-estimate a single model component for ActivitySim. This process
includes running ActivitySim in estimation mode to read household travel su... |
DJCordhose/ai | notebooks/rl/berater-v6.ipynb | mit | !pip install git+https://github.com/openai/baselines >/dev/null
!pip install gym >/dev/null
"""
Explanation: <a href="https://colab.research.google.com/github/DJCordhose/ai/blob/master/notebooks/rl/berater-v6.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab... |
asurve/arvind-sysml2 | samples/jupyter-notebooks/.ipynb_checkpoints/ALS_python_demo-checkpoint.ipynb | apache-2.0 | from pyspark.sql import SparkSession
from pyspark.sql.types import *
from systemml import MLContext, dml
spark = SparkSession\
.builder\
.appName("als-example")\
.getOrCreate()
schema = StructType([StructField("movieId", IntegerType(), True),
StructField("userId", IntegerT... |
jbogaardt/chainladder-python | docs/tutorials/development-tutorial.ipynb | mit | # Black linter, optional
%load_ext lab_black
import pandas as pd
import numpy as np
import chainladder as cl
import os
print("pandas: " + pd.__version__)
print("numpy: " + np.__version__)
print("chainladder: " + cl.__version__)
"""
Explanation: Development Tutorial
Getting Started
This tutorial focuses on selecting ... |
roatienza/Deep-Learning-Experiments | versions/2020/MLP/code/tf.keras/mnist-sampler.ipynb | mit | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.keras.datasets import mnist
import matplotlib.pyplot as plt
# load dataset
(x_train, y_train), (x_test, y_test) = mnist.load_data()
"""
Explanation: Draw sample MNIST images... |
ChadFulton/statsmodels | examples/notebooks/quantile_regression.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import print_function
import patsy
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
import matplotlib.pyplot as plt
from statsmodels.regression.quantile_regression import QuantReg
data = sm.datasets.engel.load_pandas().data
da... |
cpcloud/ibis | docs/tutorial/06-ComplexFiltering.ipynb | apache-2.0 | !curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'
import os
import tempfile
import ibis
ibis.options.interactive = True
connection = ibis.sqlite.connect(
os.path.join(tempfile.gettempdir(), 'geography.db')
)
"""
Explanation: Complex Filtering
The filtering exa... |
albahnsen/PracticalMachineLearningClass | notebooks/09-Model_Deployment.ipynb | mit | import pandas as pd
data = pd.read_csv('https://raw.githubusercontent.com/albahnsen/PracticalMachineLearningClass/master/datasets/phishing.csv')
data.head()
data.tail()
data.phishing.value_counts()
"""
Explanation: 09 - Model Deployment
by Alejandro Correa Bahnsen & Iván Torroledo
version 1.4, February 2019
Part of... |
CalPolyPat/phys202-project | .ipynb_checkpoints/Progress Report-checkpoint.ipynb | mit | import numpy as np
import matplotlib
from matplotlib import pyplot as plt
matplotlib.style.use('ggplot')
import IPython as ipynb
%matplotlib inline
"""
Explanation: An Exploration of Nueral Net Capabilities
End of explanation
"""
z = np.linspace(-10, 10, 100)
f=plt.figure(figsize=(15, 5))
plt.subplot(1, 2,1)
plt.plo... |
JasonSanchez/w261 | exams/w261mt/MIDS-MidTerm-2016-10-16.ipynb | mit | import numpy as np
from __future__ import division
%reload_ext autoreload
%autoreload 2
"""
Explanation: MIDS Machine Learning at Scale
MidTerm Exam
4:00PM - 6:00PM(CT)
October 19, 2016
Midterm
MIDS Machine Learning at Scale
Please insert your contact information here
Insert you name here : Jason Sanchez
I... |
griffinfoster/fundamentals_of_interferometry | 3_Positional_Astronomy/3_4_direction_cosine_coordinates.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
"""
Explanation: Outline
Glossary
Positional Astronomy
Previous: Horizontal Coordinates
Next: Further Reading
Import standard modules:
End of explanation
"""
fro... |
gte620v/PythonTutorialWithJupyter | exercises/solutions/Ex1-Dice_Simulation_solutions.ipynb | mit | import random
def single_die():
"""Outcome of a single die roll"""
return random.randint(1,6)
"""
Explanation: Dice Simulaiton
In this excercise, we want to simulate the outcome of rolling dice. We will walk through several levels of building up funcitonality.
Single Die
Let's create a function that will ret... |
eneskemalergin/OldBlog | _oldnotebooks/Introduction_to_Pandas-1.ipynb | mit | # Using Scalar Values
import pandas as pd
ser = pd.Series([20, 21, 12], index=['London', 'New York','Helsinki'])
print(ser)
# Using Numpy ndarray
import numpy as np
np.random.seed(100)
ser=pd.Series(np.random.rand(7))
ser
"""
Explanation: In this post I will summarize the data structures of Pandas library. Pandas is ... |
mne-tools/mne-tools.github.io | 0.17/_downloads/d4c795380277f09ea21841616baceb71/plot_dics_source_power.ipynb | bsd-3-clause | # Author: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Roman Goj <roman.goj@gmail.com>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne.datasets import sample
from mne.time_frequency import csd_morlet
from mne.beamformer import make_dics, appl... |
pauliacomi/pyGAPS | docs/examples/tplot.ipynb | mit | # import isotherms
%run import.ipynb
# import the characterisation module
import pygaps.characterisation as pgc
"""
Explanation: t-plot calculations
Another common characterisation method is the t-plot method. First, make sure the data is imported by running the previous notebook.
End of explanation
"""
isotherm = ... |
saga-survey/saga-code | ipython_notebooks/FLAGS experiments with remove list.ipynb | gpl-2.0 | data_dir = '../local_data/'
"""
Explanation: The actual catalogs were downloaded using the download_host_sqlfile.py file from https://github.com/saga-survey/marla to the data directory below
End of explanation
"""
webbrowser.open(targeting._DEFAULT_TREM_URL.replace('/export?format=csv&', '#'))
"""
Explanation: run ... |
the-deep-learners/nyc-ds-academy | notebooks/dense_sentiment_classifier.ipynb | mit | import keras
from keras.datasets import imdb
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Dense, Flatten, Dropout
from keras.layers import Embedding # new!
from keras.callbacks import ModelCheckpoint # new!
import os # new!
from sklearn.metrics im... |
ogoann/StatisticalMethods | examples/XrayImage/Summarizing.ipynb | gpl-2.0 | import astropy.io.fits as pyfits
import numpy as np
import astropy.visualization as viz
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 10.0)
targdir = 'a1835_xmm/'
imagefile = targdir+'P0098010101M2U009IMAGE_3000.FTZ'
expmapfile = targdir+'P0098010101M2U009EXPMAP3000.FTZ'
b... |
varun-invent/Autism-Connectome-Analysis | notebooks/binning_data.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import json
import string
df = pd.read_csv('/home1/varunk/data/ABIDE1/RawDataBIDs/composite_phenotypic_file.csv') # , index_col='SUB_ID'
df = df.sort_values(['SUB_ID'])
df
"""
Explanation: Data Binning
Following script is used to bin the data and check stats of participants
En... |
f-guitart/data_mining | notes/02 - Apache Spark Programming Essentials.ipynb | gpl-3.0 | import pyspark
sc = pyspark.SparkContext(appName="my_spark_app")
"""
Explanation: What is Apache Spark?
distributed framework
in-memory data structures
data processing
it improves (most of the times) Hadoop workloads
Spark enables data scientists to tackle problems with larger data sizes than they could before with... |
ES-DOC/esdoc-jupyterhub | notebooks/csir-csiro/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', 'csir-csiro', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: CSIR-CSIRO
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamical Core, Radia... |
alfkjartan/control-computarizado | discrete-time-systems/notebooks/Zero-order-hold sampling.ipynb | mit | h, lam = sy.symbols('h, lambda', real=True, positive=True)
s, z = sy.symbols('s, z', real=False)
G = 1/(s-lam)
Y = G/s
Yp = sy.apart(Y, s)
Yp
from sympy.integrals.transforms import inverse_laplace_transform
from sympy.abc import t
inverse_laplace_transform(Yp, s, t)
"""
Explanation: Zero order hold sampling of a fi... |
Saxafras/Spacetime | State Overlay Tests.ipynb | bsd-3-clause | overlay_test(rule_18.get_spacetime(),rule_18.get_spacetime(),t_max=20, x_max=20, text_color='red')
overlay_test(rule_18.get_spacetime(),rule_18.get_spacetime(),t_max=20, x_max=20, colors=plt.cm.Set2, text_color='black')
overlay_test(rule_18.get_spacetime(),rule_18.get_spacetime(),t_max=20, x_max=20, colorbar=True)
"... |
ChadFulton/statsmodels | examples/notebooks/pca_fertility_factors.ipynb | bsd-3-clause | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.multivariate.pca import PCA
"""
Explanation: Statsmodels Principal Component Analysis
Key ideas: Principal component analysis, world bank data, fertility
In this notebook, we use pri... |
WomensCodingCircle/CodingCirclePython | Lesson11_JSONandAPIs/JSONandAPIs.ipynb | mit | import json
"""
Explanation: JSON and APIs
JSON
What is JSON? From JSON.org:
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-... |
wittawatj/kernel-gof | ipynb/ex2_results.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
#%config InlineBackend.figure_format = 'svg'
#%config InlineBackend.figure_format = 'pdf'
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import kgof.data as data
import kgof.glo as glo
import kgof.goftest as gof
import kgof.kernel as kernel
i... |
sandipchatterjee/nltk_book_notes | 01_language_processing_and_python.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import nltk
from nltk.book import *
text1
text2
"""
Explanation: Language Processing and Python
Computing with Language: Texts and Words
Ran the following in python3 interpreter:
import nltk
nltk.download()
Select book to download corpora for NLTK Book
End of exp... |
samuelsinayoko/kaggle-housing-prices | research/imputation.ipynb | mit | import pandas as pd
import numpy as np
import statsmodels
from statsmodels.imputation import mice
import random
random.seed(10)
"""
Explanation: Imputation
End of explanation
"""
df = pd.read_csv("http://goo.gl/19NKXV")
df.head()
original = df.copy()
original.describe().loc['count',:]
"""
Explanation: Create ... |
computational-class/cjc2016 | code/08.06-regression.ipynb | mit | num_friends_good = [49,41,40,25,21,21,19,19,18,18,16,15,15,15,15,14,14,13,13,13,13,12,12,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4... |
arushanova/echidna | echidna/scripts/tutorials/getting_started.ipynb | mit | %pylab inline
pylab.rc("savefig", dpi=120) # set resolution of inline figures
"""
Explanation: First set up environment with convenience imports and inline plotting:
<!--- The following cell should be commented out in the python script
version of this notebook --->
End of explanation
"""
%cd ../../..
%%bash
pwd
"... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/kubeflow_pipelines/walkthrough/solutions/kfp_walkthrough.ipynb | apache-2.0 | import json
import os
import pickle
import tempfile
import time
import uuid
from typing import NamedTuple
import numpy as np
import pandas as pd
from google.cloud import bigquery
from googleapiclient import discovery, errors
from jinja2 import Template
from kfp.components import func_to_container_op
from sklearn.compo... |
saashimi/code_guild | wk1/notebooks/.ipynb_checkpoints/wk1.0-checkpoint.ipynb | mit | count = 1
for elem in range(1, 3 + 1):
count *= elem
print(count)
"""
Explanation: Wk1.0
Warm-up: I got 32767 problems and overflow is one of them.
1. Swap the values of two variables, a and b without using a temporary variable.
2. Suppose I had six different sodas. In how many different combinations could I... |
DJCordhose/ai | notebooks/nlp/1-embeddings.ipynb | mit | # Based on
# https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/6.2-understanding-recurrent-neural-networks.ipynb
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.__version__)
# htt... |
JannesKlaas/MLiFC | Week 1/Ch. 3 - Training process and the learning rate.ipynb | mit | # Numpy handles matrix multiplication, see http://www.numpy.org/
import numpy as np
# PyPlot is a matlab like plotting framework, see https://matplotlib.org/api/pyplot_api.html
import matplotlib.pyplot as plt
# This line makes it easier to plot PyPlot graphs in Jupyter Notebooks
%matplotlib inline
import sklearn
impor... |
ghvn7777/ghvn7777.github.io | content/fluent_python/3_1_dict_set.ipynb | apache-2.0 | tt = (1, 2, (30, 40))
hash(tt)
t1 = (1, 2, [30, 40]) # 其中列表是可变的,所以没有哈希值
hash(t1)
tf = (1, 2, frozenset([30, 40])) #frozenset 是冻结的集合,不可变的,所以有哈希值
hash(tf)
"""
Explanation: 我们在这章讨论字典和集合,因为它们背后都是哈希表,下面是本章的大纲
常用字典方法
特别处理遗失的键
在标准库中,dict 的变化
set 与 frozenset 形态
哈希表的工作原理
哈希表的影响(键形态限制,无法预知的排序等等)
什么是可散列化
如果一个对象有一个哈希值,而且在生命周期... |
sebastiandres/mat281 | clases/Unidad4-MachineLearning/Clase02-Clustering/clustering.ipynb | cc0-1.0 | from sklearn import datasets
import matplotlib.pyplot as plt
iris = datasets.load_iris()
def plot(dataset, ax, i, j):
ax.scatter(dataset.data[:,i], dataset.data[:,j], c=dataset.target, s=50)
ax.set_xlabel(dataset.feature_names[i], fontsize=20)
ax.set_ylabel(dataset.feature_names[j], fontsize=20)
# row and... |
lee-ngo/dataset-ice-fire | basic_python_data_science_ice_fire.ipynb | mit | type(454)
type(2.1648)
type(5 + 6 == 10) # You can put expressions in them as well!
type(5 + 72j)
type(None)
"""
Explanation: Basic Python for Data Science: A Dataset of Ice and Fire
Hello, and welcome to the Jupyter Notebook for this lesson by Lee Ngo!
If you've gotten this far, that means you've accomplished th... |
swirlingsand/deep-learning-foundations | rnns/intro-to-rnns/Anna_KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/cmip6/models/inm-cm5-0/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inm', 'inm-cm5-0', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: INM
Source ID: INM-CM5-0
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance... |
Luke035/dlnd-lessons | embedding/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
tbphu/fachkurs_master_2016 | 07_modelling/20151201_ODEcomplete.ipynb | mit | import numpy as np
# 1. initial conditions
S0 = 500. # initial population
Z0 = 0 # initial zombie population
R0 = 0 # initial death population
y0 = [S0, Z0, R0] # initial condition vector
# 2. parameter values
P = 0 # birth rate
d = 0.0001 # ... |
nsaunier/CIV8760 | Python/tutoriel-python.ipynb | mit | # esprit de Python
import this
"""
Explanation: << Table des matières
Introduction
Objectifs
Se familiariser avec Python et les Jupyter Notebook
comprendre les exemples présentés tout au long du cours, en traitement de données, données spatiales, analyse statistique et fouille de données
Commencer avec quelques exemp... |
Lolcroc/AI | ML1/lab2_original.ipynb | gpl-3.0 | NAME = ""
NAME2 = ""
NAME3 = ""
EMAIL = ""
EMAIL2 = ""
EMAIL3 = ""
"""
Explanation: Save this file as studentid1_studentid2_lab#.ipynb
(Your student-id is the number shown on your student card.)
E.g. if you work with 3 people, the notebook should be named:
12301230_3434343_1238938934_lab1.ipynb.
This will be parsed by... |
harrisonpim/bookworm | 05 - Cliques and Communities.ipynb | mit | from bookworm import *
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (12,9)
import pandas as pd
import numpy as np
import networkx as nx
"""
Explanation: < 04 - Time and Chronology | Home | 06 - Stable Roommates, Marriages, and Gender >
Cliques and Communities
End of explanati... |
google/py-decorators-tutorial | decorators-tutorial.ipynb | apache-2.0 | %%javascript
// From https://github.com/kmahelona/ipython_notebook_goodies
$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')
"""
Explanation: Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this fi... |
tpin3694/tpin3694.github.io | machine-learning/calculate_the_determinant_of_a_matrix.ipynb | mit | # Load library
import numpy as np
"""
Explanation: Title: Calculate The Determinant Of A Matrix
Slug: calculate_the_determinant_of_a_matrix
Summary: How to calculate the determinant of a matrix in Python.
Date: 2017-09-02 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
Preli... |
gunan/tensorflow | tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb | apache-2.0 | # A comma-delimited list of the words you want to train for.
# The options are: yes,no,up,down,left,right,on,off,stop,go
# All the other words will be used to train an "unknown" label and silent
# audio data with no spoken words will be used to train a "silence" label.
WANTED_WORDS = "yes,no"
# The number of steps and... |
lukas/ml-class | examples/keras-fashion/sweeps.ipynb | gpl-2.0 | # WandB – Install the W&B library
%pip install wandb -q
import wandb
from wandb.keras import WandbCallback
!pip install wandb -qq
from keras.datasets import fashion_mnist
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Dropout, Dense, Flatten
from keras.utils import np_utils
from ker... |
tensorflow/docs-l10n | site/ja/tensorboard/dataframe_api.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... |
dennisobrien/bokeh | examples/howto/server_embed/notebook_embed.ipynb | bsd-3-clause | import yaml
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.themes import Theme
from bokeh.io import show, output_notebook
from bokeh.sampledata.sea_surface_temperature import sea_surface_temperature
output_notebook()
"""
Explanation: E... |
ueapy/ueapy.github.io | content/notebooks/2019-05-30-cartopy-map.ipynb | mit | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import xarray as xr
from pathlib import Path
"""
Explanation: To make a pretty, publication grade map for your study area look no further than cartopy.
In this tutorial we will walk through generating a basemap with:
- Bathymetry/topography
- Coast... |
Vvkmnn/books | AutomateTheBoringStuffWithPython/lesson42.ipynb | gpl-3.0 | import openpyxl
"""
Explanation: Lesson 42:
Reading Excel Spreadsheets
The openpyxl module allows you to manipulate Excel sheets within Python.
Excel files have the following terminology:
* A collection of sheets is a workbook, and saved with a .xlsx extension.
* A workbook contains multiple sheets, each of which is... |
tensorflow/docs-l10n | site/ja/io/tutorials/audio.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... |
phoebe-project/phoebe2-docs | 2.1/tutorials/eclipse.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Eclipse Detection
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
"""
%matplotlib inline
im... |
4dsolutions/Python5 | Extended Precision.ipynb | mit | %%latex
\begin{align}
e = lim_{n \to \infty} (1 + 1/n)^n
\end{align}
from math import e, pi
print(e) # as a floating point number
print(pi)
"""
Explanation: Python for Everyone!<br/>Oregon Curriculum Network
Extended Precision with the Native Decimal Type
With LaTeX and Generator Functions
<img src="https://c8.stati... |
dipanjank/ml | data_analysis/blood_transfusion_uci.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
%pylab inline
pylab.style.use('ggplot')
"""
Explanation: <h1 align="center">UCI machine-learning-databases/blood-transfusion</h1>
End of explanation
"""
url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/blood-transfusion/transfusion.data'
data_df = pd.read_csv(ur... |
possnfiffer/py-emde | Py-EMDE-Kenya-GLOBE-02.ipynb | bsd-2-clause | import requests
import json
r = requests.get('http://3d-kenya.chordsrt.com/instruments/2.geojson?start=2017-03-01T00:00&end=2017-05-01T00:00')
if r.status_code == 200:
d = r.json()['Data']
else:
print("Please verify that the URL for the weather station is correct. You may just have to try again with a differe... |
mne-tools/mne-tools.github.io | 0.24/_downloads/6d98b103d247000f4433763dd76607c0/25_background_filtering.ipynb | bsd-3-clause | import numpy as np
from numpy.fft import fft, fftfreq
from scipy import signal
import matplotlib.pyplot as plt
from mne.time_frequency.tfr import morlet
from mne.viz import plot_filter, plot_ideal_filter
import mne
sfreq = 1000.
f_p = 40.
flim = (1., sfreq / 2.) # limits for plotting
"""
Explanation: Background in... |
dnc1994/MachineLearning-UW | ml-classification/blank/module-8-boosting-assignment-2-blank.ipynb | mit | import graphlab
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Boosting a decision stump
The goal of this notebook is to implement your own boosting module.
Brace yourselves! This is going to be a fun and challenging assignment.
Use SFrames to do some feature engineering.
Modify the decision tree... |
NuGrid/NuPyCEE | DOC/Capabilities/Delayed_extra_sources.ipynb | bsd-3-clause | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from NuPyCEE import sygma
"""
Explanation: Delayed Extra Sources in NuPyCEE
Created by Benoit Côté
This notebook introduces the general delayed-extra set of parameters in NuPyCEE that allows to include any enrichment source that requires a delay-time... |
ML4DS/ML4all | R4.ML_Regression/Regression_ML_professor.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.io # To read matlab files
import pylab
"""
Explanation: Parametric Model-Based reg... |
oditorium/blog | iPython/MCPricing2-CallLognorm.ipynb | agpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: iPython Cookbook - Monte Carlo Pricing II - Call (Lognormal)
Pricing a call option with Monte Carlo (Normal model)
End of explanation
"""
strike = 100
mat = 1
forward = 100
vol = 0.3
"""
Explanation: Those are our option and market pa... |
palrogg/foundations-homework | Data_and_databases/Homework_4_Paul_Ronga.ipynb | mit | numbers_str = '496,258,332,550,506,699,7,985,171,581,436,804,736,528,65,855,68,279,721,120'
"""
Explanation: Homework #4
These problem sets focus on list comprehensions, string operations and regular expressions.
Problem set #1: List slices and list comprehensions
Let's start with some data. The following cell contain... |
mne-tools/mne-tools.github.io | stable/_downloads/c37ac181bfe2eb2f1fa69c3fab30417d/mne_cov_power.ipynb | bsd-3-clause | # Author: Denis A. Engemann <denis-alexander.engemann@inria.fr>
# Luke Bloy <luke.bloy@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
import mne
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse_cov
data_path = sample.data_path()
s... |
benkoo/fast_ai_coursenotes | deeplearning1/nbs/lesson1.ipynb | apache-2.0 | %matplotlib inline
import keras.backend as K
K.set_image_dim_ordering('th')
"""
Explanation: Using Convolutional Neural Networks
Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thank... |
jtwalsh0/methods | .ipynb_checkpoints/Statistics-checkpoint.ipynb | mit | %%latex
\begin{align*}
f_X(X=x) &= cx^2, 0 \leq x \leq 2 \\
1 &= c\int_0^2 x^2 dx \\
&= c[\frac{1}{3}x^3 + d]_0^2 \\
&= c[\frac{8}{3} + d - d] \\
&= c[\frac{8}{3}] \\
f_X(X=x) &= \frac{3}{8}x^2, 0 \leq x \leq 2
\end{align*}
u = np.random.uniform(size=100000)
x = 2 * u**.3333
df = pd.DataFrame... |
marxav/hello-world | ann_101_numpy_step_by_step.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/ann_101_numpy_step_by_step.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Import Python Libr... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/NLP/LSTM RNN/Sentiment pytorch/Sentiment_RNN.ipynb | apache-2.0 | import numpy as np
# read data from text files
with open('data/reviews.txt', 'r') as f:
reviews = f.read()
with open('data/labels.txt', 'r') as f:
labels = f.read()
print(reviews[:1000])
print()
print(labels[:20])
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent ... |
numeristical/introspective | examples/Calibration_Example_ICU_MIMIC.ipynb | mit | # "pip install ml_insights" in terminal if needed
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import ml_insights as mli
%matplotlib inline
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import train_test_split, StratifiedKFold
from sklearn.metrics import r... |
mastertrojan/Udacity | tv-script-generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.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... |
rasbt/python-machine-learning-book | code/bonus/scikit-model-to-json.ipynb | mit | %load_ext watermark
%watermark -a 'Sebastian Raschka' -v -d -p scikit-learn,numpy,scipy
# to install watermark just uncomment the following line:
#%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
"""
Explanation: Sebastian Raschka, 2016
https://github.com/rasbt/python-machine-learnin... |
seansweeney/NEARC-2017 | Updating AGOL item metadata_with_outputs.ipynb | unlicense | from arcgis.gis import GIS
from getpass import getpass
from IPython.display import display
"""
Explanation: Import the GIS module and other needed Python modules
The IPython.display module has some helper functions that the Python API takes advantage of for displaying objects like item details and maps in the notebook... |
minireference/noBSLAnotebooks | chapter02_linearity_intuition.ipynb | mit | # setup SymPy
from sympy import *
init_printing()
x, y, z, t = symbols('x y z t')
alpha, beta = symbols('alpha beta')
"""
Explanation: 2/ Linearity
End of explanation
"""
b, m = symbols('b m')
def f(x):
return m*x
f(1)
f(2)
f(1+2)
f(1) + f(2)
expand(f(x+y)) == f(x) + f(y)
"""
Explanation: Simplest linear... |
julienchastang/unidata-python-workshop | notebooks/Bonus/What to do when things go wrong.ipynb | mit | while = 1
"""
Explanation: <div style="width:1000 px">
<div style="float:right; width:98 px; height:98px;">
<img src="https://raw.githubusercontent.com/Unidata/MetPy/master/metpy/plots/_static/unidata_150x150.png" alt="Unidata Logo" style="height: 98px;">
</div>
<h1>What to do when things go wrong</h1>
<h3>Unidata P... |
danielbarter/personal_website_code | blog_notebooks/mnist/helm_mnist.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style({"font.family" : ["Serif"]})
"""
Explanation: Let's check out MNIST
End of explanation
"""
# tensorflow mnist downloader
from tensorflow.examples.tutorials.mnist import input_data
mnist ... |
EVS-ATMOS/cmac2.0 | notebooks/DDLobes.ipynb | bsd-3-clause | import pyart
import gzip
from matplotlib import pyplot as plt
from matplotlib import rcParams
from scipy import ndimage
import shutil, os
from datetime import timedelta, datetime
import numpy as np
import tempfile
import glob
import re
from copy import deepcopy
from IPython.display import Image, display
import math
%ma... |
DJCordhose/ai | notebooks/md/4-keras-tensorflow-nn.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import pandas as pd
print(pd.__version__)
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.__version__)
import keras
print(keras.__version__)
"""
Explanation: Neural Networks with TensorFlow and Keras
End ... |
chinapnr/python_study | Python 基础课程/Python Basic Lesson 06 - 随机数.ipynb | gpl-3.0 | import random
# random.choice(sequence)。参数sequence表示一个有序类型。
# random.choice 从序列中获取一个随机元素。
print(random.choice(range(1,100)))
# 从一个列表中产生随机元素
list1 = ['a', 'b', 'c']
print(random.choice(list1))
# random.sample()
# 创建指定范围内指定个数的整数随机数
print(random.sample(range(1,100), 10))
print(random.sample(range(1,10), 5))
# 如果要产生... |
saezlab/kinact | doc/KSEA_example.ipynb | gpl-3.0 | # Import useful libraries
import numpy as np
import pandas as pd
# Import required libraries for data visualisation
import matplotlib.pyplot as plt
import seaborn as sns
# Import the package
import kinact
# Magic
%matplotlib inline
"""
Explanation: Protocol for Kinase-Substrate Enrichment Analysis (KSEA)
This IPyth... |
yl565/statsmodels | examples/notebooks/glm.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
from scipy import stats
from matplotlib import pyplot as plt
"""
Explanation: Generalized Linear Models
End of explanation
"""
print(sm.datasets.star98.NOTE)
"""
Explanation: GLM: Binomial response data
Load da... |
phoebe-project/phoebe2-docs | 2.3/tutorials/distance.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Distance
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
from phoebe import u # units
import numpy as np
import matplo... |
yogeshVU/matplotlib_apps | MatPlotLib.ipynb | mit | %matplotlib inline
from scipy.stats import norm
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-3, 3, 0.001)
plt.plot(x, norm.pdf(x))
plt.show()
"""
Explanation: MatPlotLib Basics
Draw a line graph
End of explanation
"""
plt.plot(x, norm.pdf(x))
plt.plot(x, norm.pdf(x, 1.0, 0.5))
plt.show()
"""... |
otavio-r-filho/AIND-Deep_Learning_Notebooks | batch-norm/Batch_Normalization_Exercises.ipynb | mit | import tensorflow as tf
import numpy as np
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,... |
AnyBody-Research-Group/AnyPyTools | docs/slides/Automate your AnyBody simulations.ipynb | mit | from anypytools import AnyPyProcess
app = AnyPyProcess( )
macrolist = [
'load "Knee.any"',
'classoperation Main.MyParameter "Set Value" --value="10"',
'operation Main.MyStudy.Kinematics',
'run',
'exit'
]
app.start_macro(macrolist);
"""
Explanation: <img src="https://avatars.githubusercontent.co... |
tleonhardt/CodingPlayground | dataquest/SQL_and_Databases/SQLite_Relations.ipynb | mit | import sqlite3
# Conect to nominations.db
conn = sqlite3.connect('../data/nominations.db')
# Return the schema using "pragma table_info()"
query = "pragma table_info(nominations);"
schema = conn.execute(query).fetchall()
schema
# Return the first 10 rows using the SELECT and LIMIT statements
query = "SELECT * FROM n... |
DesignSafe-CI/adama_example | notebooks/Demo.ipynb | mit | cd demo
"""
Explanation: Adama example for DesignSafe-CI
This is an example of building an Adama service.
We use the Haiti Earthquake Database and we construct a couple of web services from the data hosted at https://nees.org/dataview/spreadsheet/haiti.
Setting up
The code for these services is in the directory dem... |
intel-analytics/BigDL | apps/ray/parameter_server/sharded_parameter_server.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import ray
import time
"""
Explanation: This notebook is adapted from:
https://github.com/ray-project/tutorial/tree/master/examples/sharded_parameter_server.ipynb
Sharded Parameter Servers
G... |
ykakihara/experiments | tech-circle9/chainer-natual-language-processing.ipynb | mit | import time
import math
import sys
import pickle
import copy
import os
import re
import numpy as np
from chainer import cuda, Variable, FunctionSet, optimizers
import chainer.functions as F
"""
Explanation: Introduction
Chainer とはニューラルネットの実装を簡単にしたフレームワークです。
今回は言語の分野でニューラルネットを適用してみました。
今回は言語モデルを作成していただきます。
言語モデルと... |
keflavich/pyspeckit | examples/AmmoniaLevelPopulation.ipynb | mit | # This is a test to show what happens if you add lines vs. computing a single optical depth per channel
from pyspeckit.spectrum.models.ammonia_constants import (line_names, freq_dict, aval_dict, ortho_dict,
voff_lines_dict, tau_wts_dict)
from astropy import constants
from astropy import ... |
abhi1509/deep-learning | intro-to-rnns/Anna_KaRNNa_Exercises.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, we'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 bas... |
grananqvist/TDA602_ApplicationIPS | Plots_technical_background.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
"""
Explanation: The code in this notebook is entirely for making example plots to use in the technical background of the report
This notebook doesn't have any relation to the overall firewall project
End of explanatio... |
vivekec/datascience | tutorials/python/Ipython files/Seaborn - 1. Introduction.ipynb | gpl-3.0 | # Collective data
def sinplot(flip=1):
x = np.linspace(0, 14, 100)
for i in range(1, 7):
plt.plot(x, np.sin(x + i * .5) * (7 - i) * flip)
# Individual data
data = np.random.normal(size=(20, 6)) + np.arange(6) / 2
"""
Explanation: 1. Controlling figure aesthetics
Let us generate some data to wo... |
steven-murray/halomod | devel/fix_angular_cf.ipynb | mit | from halomod import AngularCF
import halomod
halomod.__version__
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Fix Amplitude of Angular CF
There was a bug reported that AngularCF is returning really large values for the tracer correlation function, specifically for v1.6.0 of ... |
empet/geom_modeling | Catmull-Rom-splines.ipynb | bsd-2-clause | from IPython.display import Image
Image(filename='Imag/Catmull-Rom-curve.png')
"""
Explanation: Catmull-Rom splines
Definition of this class of curves
The Catmull-Rom interpolation problem defined in [Catmull, E. and R. Rom, A Class of Local Interpolationg Splines, in Barnhill R.E. and R.F. Riesenfeld (eds.), Computer... |
dtamayo/rebound | ipython_examples/Horizons.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add("Sun")
## Other examples:
# sim.add("Venus")
# sim.add("399")
# sim.add("Europa")
# sim.add("NAME=Ida")
# sim.add("Pluto")
# sim.add("NAME=Pluto")
sim.status()
"""
Explanation: Adding particles using NASA JPL Horizons system
REBOUND can add particles to simulations by ... |
SheffieldML/notebook | GPy/config.ipynb | bsd-3-clause | # This is the default configuration file for GPy
# Do note edit this file.
# For machine specific changes (i.e. those specific to a given installation) edit GPy/installation.cfg
# For user specific changes edit $HOME/.gpy_user.cfg
[parallel]
# Enable openmp support. This speeds up some computations, depending on the... |
ES-DOC/esdoc-jupyterhub | notebooks/bnu/cmip6/models/sandbox-3/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: BNU
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties: 3... |
fschueler/incubator-systemml | projects/breast_cancer/MachineLearning.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import os
import matplotlib.pyplot as plt
import numpy as np
from pyspark.sql.functions import col, max
import systemml # pip3 install systemml
from systemml import MLContext, dml
plt.rcParams['figure.figsize'] = (10, 6)
ml = MLContext(sc)
"""
Explanation: Pre... |
tensorflow/docs-l10n | site/zh-cn/quantum/tutorials/barren_plateaus.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.