repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
mne-tools/mne-tools.github.io | 0.17/_downloads/76291d3769ed01aa3e696d309cd4e2fd/plot_creating_data_structures.ipynb | bsd-3-clause | import mne
import numpy as np
"""
Explanation: Creating MNE's data structures from scratch
MNE provides mechanisms for creating various core objects directly from
NumPy arrays.
End of explanation
"""
# Create some dummy metadata
n_channels = 32
sampling_rate = 200
info = mne.create_info(n_channels, sampling_rate)
pr... |
empet/Matplotlib-plots | Asymmetric-diverging-colormaps-in-matplotlib.ipynb | gpl-3.0 | import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
sns.set(style="white")
"""
Explanation: Asymmetric diverging colormaps in Matplotlib
End of explanation
"""
def display_cmap(cmap):
plt.imshow(np.linspace(0, 100, 256)[None, :], aspe... |
dnc1994/MachineLearning-UW | ml-classification/blank/module-5-decision-tree-assignment-1-blank.ipynb | mit | import graphlab
graphlab.canvas.set_target('ipynb')
"""
Explanation: Identifying safe loans with decision trees
The LendingClub is a peer-to-peer leading company that directly connects borrowers and potential lenders/investors. In this notebook, you will build a classification model to predict whether or not a loan pr... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/cmip6/models/sandbox-1/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepping Framework,... |
lukin155/skola-programiranja | 03-Stringovi-promenljive-tipovi-podataka-interakcija.ipynb | mit | print("This is a "small" program")
"""
Explanation: "Escape" karakter
Pokušajte da funkcijom <i>print</i> prikažete na ekranu (odštampate) tekst koji sadrži navodnike, npr. <i>This is a "small" program</i>.<br />
Probajte ovako:
End of explanation
"""
print("This is a \"small\" program")
"""
Explanation: Obratite p... |
pchrapka/brain-modelling | experiments/exp34-mne-python/plot_lcmv_beamformer_volume.ipynb | mit | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.beamformer import lcmv
from nilearn.plotting import plot_stat_map
from nilearn.image import index_img
print(__doc_... |
nicoguaro/AdvancedMath | notebooks/complex numbers.ipynb | mit | from sympy import *
init_printing()
a, a1, a2, a3 = symbols("a a1 a2 a3", real=True)
b, b1, b2, b3 = symbols("b b1 b2 b3", real=True)
"""
Explanation: Complex numbers and operation on complex numbers
From A.G. Sveshnokov, A.N. Tikhonov (1982). The theory of functions of a complex variable. Section 1.1.
The concept of... |
eds-uga/csci1360-fa16 | assignments/A6/A6_Q2.ipynb | mit | import numpy as np
np.random.seed(57442)
x1 = np.random.random(10)
x2 = np.random.random(10)
np.testing.assert_allclose(x1.dot(x2), dot(x1, x2))
import numpy as np
np.random.seed(495835)
x1 = np.random.random(100)
x2 = np.random.random(100)
np.testing.assert_allclose(x1.dot(x2), dot(x1, x2))
"""
Explanation: Q2
Thi... |
ahetrick/Projects | Text-Mining/Reddit-Tech-Sentiment-Analysis.ipynb | gpl-3.0 | import nltk
stopwords = nltk.corpus.stopwords.words("english")
with open('./data/wozniak_text.txt') as f:
wozniak_string = f.read()
wozniak_tokens = nltk.word_tokenize(wozniak_string)
replace_punct = [word.replace("'", '').replace('"','') for word in wozniak_tokens]
alpha = [word for word in replace_punct if... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/04_03/Final/Indexing.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
produce_dict = {'veggies': ['potatoes', 'onions', 'peppers', 'carrots'],'fruits': ['apples', 'bananas', 'pineapple', 'berries']}
produce_df = pd.DataFrame(produce_dict)
produce_df
"""
Explanation: Indexing and Selection
| Operation | Syntax | Result ... |
rokkamsatyakalyan/Machine_Learning | Nursery/Nursery.ipynb | gpl-3.0 | # Importing the libraries which we need now.
import pandas
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
%matplotlib inline
# Dataset from - https://archive.ics.uci.edu/ml/datasets/Nursery
df = pandas.read_table('nursery.txt', sep=',', header=None, names=['parents', 'has_nurs', 'form... |
intel-analytics/analytics-zoo | pyzoo/zoo/chronos/use-case/network_traffic/network_traffic_autots_customized_model.ipynb | apache-2.0 | import matplotlib.pyplot as plt
def plot_predict_actual_values(date, y_pred, y_test, ylabel):
"""
plot the predicted values and actual values (for the test data)
"""
fig, axs = plt.subplots(figsize=(16, 6))
axs.plot(date, y_pred, color='red', label='predicted values')
axs.plot(date, y_test, col... |
bureaucratic-labs/yargy | docs/cookbook.ipynb | mit | from yargy.parser import prepare_trees
from yargy import Parser, or_, rule
A = or_(
rule('a'),
rule('a', 'a')
)
B = A.repeatable()
display(B.normalized.as_bnf)
parser = Parser(B)
matches = parser.extract('a a a')
for match in matches:
# кроме 3-х полных разборов, парсёр найдёт ещё 7 частичных: (a) _ _... |
ES-DOC/esdoc-jupyterhub | notebooks/nuist/cmip6/models/sandbox-2/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-2', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: NUIST
Source ID: SANDBOX-2
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turb... |
florent-leclercq/borg_sdss_data_release | borg_sdss_classifiers/borg_sdss_classifiers.ipynb | gpl-3.0 | import numpy as np
tweb = np.load('borg_sdss_tweb.npz')
diva = np.load('borg_sdss_diva.npz')
origami = np.load('borg_sdss_origami.npz')
"""
Explanation: BORG SDSS data products
borg_sdss_classifiers package
Authors: Florent Leclercq, Guilhem Lavaux, Jens Jasche, Benjamin Wandelt
Last update: 09/10/2018
This package ... |
rasbt/algorithms_in_ipython_notebooks | ipython_nbs/search/binary_search.ipynb | gpl-3.0 | def binary_search(array, value):
ary = array
min_idx = 0
max_idx = len(array)
while min_idx < max_idx:
middle_idx = (min_idx + max_idx) // 2
if array[middle_idx] == value:
return middle_idx
elif array[middle_idx] < value:
min_idx = middle_idx + 1
... |
rflamary/POT | docs/source/auto_examples/plot_barycenter_fgw.ipynb | mit | # Author: Titouan Vayer <titouan.vayer@irisa.fr>
#
# License: MIT License
#%% load libraries
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
import math
from scipy.sparse.csgraph import shortest_path
import matplotlib.colors as mcol
from matplotlib import cm
from ot.gromov import fgw_barycente... |
GoogleCloudPlatform/ai-notebooks-extended | dataproc-hub-example/build/infrastructure-builder/mig/files/gcs_working_folder/examples/Python/bigquery/Getting started with BigQuery ML.ipynb | apache-2.0 | from google.cloud import bigquery
client = bigquery.Client(location="US")
"""
Explanation: Getting started with BigQuery ML
BigQuery ML enables users to create and execute machine learning models in BigQuery using SQL queries. The goal is to democratize machine learning by enabling SQL practitioners to build models u... |
shengshuyang/PCLCombinedObjectDetection | TheanoLearning/TheanoLearning/theano_demo.ipynb | gpl-2.0 | import time
import numpy as np
#import matplotlib.pyplot as plt
import theano
# By convention, the tensor submodule is loaded as T
import theano.tensor as T
"""
Explanation: Basics about Theano
First let's do the standard import
End of explanation
"""
A = T.matrix('A')
b = T.scalar('b')
v = T.vector('v')
print A.ty... |
maojrs/riemann_book | Make_html_animations.ipynb | bsd-3-clause | %matplotlib inline
from IPython.display import FileLink
"""
Explanation: Make animations for webpage
Create html versions of some animations to be uploaded to the webpage. Links from the pdf version of the book will go to these versions for readers who are only reading the pdf.
Note that make_html_on_master.py will ... |
transcranial/keras-js | notebooks/layers/convolutional/Conv2D.ipynb | mit | data_in_shape = (5, 5, 2)
conv = Conv2D(4, (3,3), strides=(1,1), padding='valid',
data_format='channels_last', dilation_rate=(1,1),
activation='linear', use_bias=True)
layer_0 = Input(shape=data_in_shape)
layer_1 = conv(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)
# set weights ... |
mohanprasath/Course-Work | coursera/python_for_data_science/3.2_loops.ipynb | gpl-3.0 | range(3)
"""
Explanation: <a href="http://cocl.us/topNotebooksPython101Coursera"><img src = "https://ibm.box.com/shared/static/yfe6h4az47ktg2mm9h05wby2n7e8kei3.png" width = 750, align = "center"></a>
<a href="https://www.bigdatauniversity.com"><img src = "https://ibm.box.com/shared/static/ugcqz6ohbvff804xp84y4kqnvvk3b... |
aspratyush/audio-signal-processing | DFT.ipynb | lgpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: DFT
DFT using complex sinusoids
End of explanation
"""
N = 512
n = np.arange(-N/2, N/2)
Fs = 16000
f = 100
A = 0.75
# I/P signal
x1 = A*np.exp(1j*2*np.pi*f*n/Fs)
x2 = A*np.sin(2*np.pi*f*n/Fs)
plt.subplot(221)
plt.plot(n,np.real(x))
plt.grid('on')
... |
akseshina/dl_course | seminar_3/classwork_2.ipynb | gpl-3.0 | import cifar10
"""
Explanation: Load Data
End of explanation
"""
cifar10.maybe_download_and_extract()
"""
Explanation: Set the path for storing the data-set on your computer.
The CIFAR-10 data-set is about 163 MB and will be downloaded automatically if it is not located in the given path.
End of explanation
"""
c... |
science-of-imagination/nengo-buffer | Project/mental_scaling_training.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
%matplotlib inline
import nengo
import numpy as np
import scipy.ndimage
import matplotlib.animation as animation
from matplotlib import pylab
from PIL import Image
import nengo.spa as spa
import cPickle
import random
from nengo_extras.data import load_mnist
from nengo_extras.vision impo... |
vbsteja/code | Python/ML_DL/DL/Neural-Networks-Demystified-master/Part 6 Training.ipynb | apache-2.0 | from IPython.display import YouTubeVideo
YouTubeVideo('9KM9Td6RVgQ')
"""
Explanation: <h1 align = 'center'> Neural Networks Demystified </h1>
<h2 align = 'center'> Part 6: Training </h2>
<h4 align = 'center' > @stephencwelch </h4>
End of explanation
"""
%pylab inline
#Import code from previous videos:
from partFive... |
saketkc/notebooks | python/Mixed_Linear_Models.ipynb | bsd-2-clause | import numpy as np
import statsmodels.api as sm
import pandas
import statsmodels.formula.api as smf
data = pandas.read_csv('http://vincentarelbundock.github.io/Rdatasets/csv/lme4/Penicillin.csv', index_col=0)
print data.describe(include='all')
print (data.columns.values)
print data['sample'].describe()
print data['... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/building_production_ml_systems/labs/1_training_at_scale.ipynb | apache-2.0 | # change these to try this notebook out
PROJECT = <YOUR PROJECT>
BUCKET = <YOUR PROJECT>
REGION = <YOUR REGION>
import os
os.environ['PROJECT'] = PROJECT
os.environ['BUCKET'] = BUCKET
os.environ['REGION'] = REGION
os.environ['TFVERSION'] = "2.1"
%%bash
gcloud config set project $PROJECT
gcloud config set compute/regi... |
ES-DOC/esdoc-jupyterhub | notebooks/ncar/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', 'ncar', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: NCAR
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
sbenthall/bigbang | examples/experimental_notebooks/Testing Power Law Response Time Hypothesis.ipynb | agpl-3.0 | from bigbang.archive import Archive
import pandas as pd
arx = Archive("ipython-dev",archive_dir="../archives")
print arx.data.shape
arx.data.drop_duplicates(subset=('From','Date'),inplace=True)
"""
Explanation: An early result in the study of human dynamic systems is the claim that response times to email follow a p... |
arokem/seaborn | doc/docstrings/histplot.ipynb | bsd-3-clause | sns.histplot(data=penguins, y="flipper_length_mm")
"""
Explanation: Flip the plot by assigning the data variable to the y axis:
End of explanation
"""
sns.histplot(data=penguins, x="flipper_length_mm", binwidth=3)
"""
Explanation: Check how well the histogram represents the data by specifying a different bin width:... |
bjodah/pyneqsys | examples/multiprecision.ipynb | bsd-2-clause | import sympy as sp
from pyneqsys.symbolic import SymbolicSys
sp.init_printing()
def f(x):
return [x[0]**2 + x[1],
5*x[0]**2 - 3*x[0] + 2*x[1] - 3]
neqsys = SymbolicSys.from_callback(f, 2)
neqsys.exprs
"""
Explanation: Arbitrary precision
Typically numerical optimization is performed using binary 64 b... |
dmoliveira/My-Data-Science-Toolbox | Notebooks/Quick-Reference-Guide-NLTK/Quick-Reference-Guide-NLTK.ipynb | gpl-2.0 | import nltk
from __future__ import division
import matplotlib as mpl
from matplotlib import pyplot as plt
from nltk.book import *
from nltk.corpus import brown
from nltk.corpus import udhr
from nltk.corpus import wordnet as wn
from numpy import arange
import networkx as nx
%matplotlib inline
"""
Explanation: Quick Ref... |
ethen8181/machine-learning | keras/rnn_language_model_basic_keras.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', 'notebook_format'))
from formats import load_style
load_style(plot_style = False)
os.chdir(path)
import os
import string
import numpy as np
import panda... |
3upperm2n/trans_kernel_model | mem_mem/tests/maxCC2_3cke/cc2_3cke.ipynb | mit | %load_ext autoreload
%autoreload 2
import warnings
import pandas as pd
import numpy as np
import os
import sys # error msg, add the modules
import operator # sorting
from math import *
import matplotlib.pyplot as plt
sys.path.append('../../')
import cuda_timeline
import read_trace
import avgblk
import cke
from model... |
empet/LinAlgCS | Matplotlib.ipynb | bsd-3-clause | %matplotlib inline
"""
Explanation: Grafica 2D folosind modulul pyplot din matplotlib
Matplotlib este o bibiloteca care permite generarea si afisarea unor obiecte grafice 2D si 3D. Modulul matplotlib.pyplot contine functii ce genereaza grafice de functii, vizualizeaza multimi de puncte, matrici ca imagini, bare, ... |
sanjaymeena/ProgrammingProblems | python/.ipynb_checkpoints/python-exercises-checkpoint.ipynb | apache-2.0 | import math
import numpy as np
import pandas as pd
import re
from operator import itemgetter, attrgetter
"""
Explanation: Python Exercises
This notebook is for programming exercises in python using :
Statistics
Inbuilt Functions and Libraries
Pandas
Numpy
End of explanation
"""
def median(dataPoints):
"comp... |
grokkaine/biopycourse | day2/stats_pandas.ipynb | cc0-1.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
s = pd.Series([1, 9, 2, 10, np.nan, 6])
df1 = pd.DataFrame(np.random.randn(3,5),index=s[1:4],columns=list('ABCDF'))
df2 = pd.DataFrame({'number' : 1.,
'dates' : pd.date_range('20150720',periods=4),
'floats' :... |
bbglab/adventofcode | 2020/claudia/2020_12_01/code.ipynb | mit | input_f = './input.txt'
# Read expenses
expenses = set()
with open(input_f, 'r') as fd:
for line in fd:
expenses.add(int(line.strip()))
"""
Explanation: Day 1
End of explanation
"""
# Find 2 expenses that add up to 2020 and get their product
stop = 0
for exp1 in expenses:
for exp2 in expenses:
... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session11/Day4/CoadditionAndSubtraction.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import MultipleLocator
from scipy.stats import norm
def pixel_plot(pix, counts, fig=None, ax=None):
'''Make a pixelated 1D plot'''
if fig is None and ax is None:
fig, ax = plt.subplots()
ax.step(pix, counts,
... |
ClimateTools/Correlation_EPSL | CrystalCave.ipynb | mit | %matplotlib inline
import numpy as np
from numpy import genfromtxt
from lipd.start import *
from mpl_toolkits.basemap import Basemap
from scipy.stats.mstats import mquantiles
from scipy import interpolate
from scipy.interpolate import UnivariateSpline
from scipy.signal import butter, lfilter, filtfilt
import matplotlib... |
AllenDowney/ThinkBayes2 | soln/beta_leftover.ipynb | mit | # If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install empiricaldist
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from empiricaldist import Pmf
from utils import decorate... |
JAmarel/Phys202 | LaTeX/Display.ipynb | mit | class Ball(object):
pass
b = Ball()
b.__repr__()
print(b)
"""
Explanation: Display of Rich Output
In Python, objects can declare their textual representation using the __repr__ method.
End of explanation
"""
class Ball(object):
def __repr__(self):
return 'TEST'
b = Ball()
print(b)
"""
Explanatio... |
phoebe-project/phoebe2-docs | development/tutorials/reflection_heating.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Reflection and Heating
For a comparison between "Horvat" and "Wilson" methods in the "irad_method" parameter, see the tutorial on Lambert Scattering.
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an... |
phanrahan/magmathon | projects/digits_recognition/tutorial_digits_recognition_on_icestick.ipynb | mit | image_id = 9
filename = 'nn_train/BNN.pkl'
"""
Explanation: MNIST handwritten digits recognition
Written by Yujun Lin
Preparation
Follow the instructions on notebook for training a binary single-layer perception and saving weights and images to local file.
change image_id for other pictures. There are 10 pictures in t... |
amkatrutsa/MIPT-Opt | Spring2017-2019/14-Newton/Seminar14.ipynb | mit | import numpy as np
USE_COLAB = False
if USE_COLAB:
!pip install git+https://github.com/amkatrutsa/liboptpy
import liboptpy.unconstr_solvers as methods
import liboptpy.step_size as ss
n = 1000
m = 200
x0 = np.zeros((n,))
A = np.random.rand(n, m) * 10
"""
Explanation: Метод Ньютона: дорого и быстро
На про... |
heatseeknyc/data-science | src/bryan analyses/Hack for Heat #2.ipynb | mit | hpdcompprob = pd.read_csv("Complaint_Problems.csv")
type(hpdcompprob.StatusDate[0])
"""
Explanation: Hack for Heat #2: Problem types over time
In this post, I'm going to explore how we might track the composition of problems that the HPD(Housing Preservation and Development Board) might receive over time. The data th... |
kamujun/exercise_of_deep_larning_from_scratch | notebooks/section5.ipynb | mit | import matplotlib.pyplot as plt
from graphviz import Digraph
from matplotlib.image import imread
f = Digraph(format="png")
f.attr(rankdir='LR', size='8,5')
f.attr('node', shape='circle')
f.edge('apple', '×2', label='100')
f.edge('×2', '×1.1', label='200')
f.edge('×1.1', 'cash', label='220')
f.render("../docs/5_1_1")... |
tylere/docker-tmpnb-ee | notebooks/1 - IPython Notebook Examples/IPython Project Examples/Notebook/Importing Notebooks.ipynb | apache-2.0 | import io, os, sys, types
from IPython.nbformat import current
from IPython.core.interactiveshell import InteractiveShell
"""
Explanation: Importing IPython Notebooks as Modules
It is a common problem that people want to import code from IPython Notebooks.
This is made difficult by the fact that Notebooks are not pla... |
sudhanshuptl/Machine-Learning | Data Analysis learning/Data_Analysis_3(pandas Basics).ipynb | gpl-2.0 | import pandas as pd
"""
Explanation: Pandas basics
End of explanation
"""
s=pd.Series([2,3,4,5,6])
print s.describe()
"""
Explanation: <h3>Pandas series</h3>
<p>
pandas series is similar to numpy array, But it suppport lots of extra functionality like <b> Pandaseries.describe()</b>
</p>
<p>
Basic acces is samilar t... |
the-deep-learners/study-group | neural-networks-and-deep-learning/src/run_network.ipynb | mit | import mnist_loader
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
"""
Explanation: Network from Nielsen's Chapter 1
http://neuralnetworksanddeeplearning.com/chap1.html#implementing_our_network_to_classify_digits
Load MNIST Data
End of explanation
"""
import network
# 784 (28 x 28 pix... |
thinkingmachines/deeplearningworkshop | codelab_2_tensorflow_graph.ipynb | mit | import tensorflow as tf
node1 = tf.constant(3.0, dtype=tf.float32)
node2 = tf.constant(4.0) #dtype float32 is a default
print(node1, node2)
"""
Explanation: Tensorflow Fundamental Computational Graph
Tensorflow Core layer. Building computational graphs!
End of explanation
"""
sess = tf.Session()
print( sess.run([... |
daniestevez/jupyter_notebooks | dslwp/DSLWP tracking file analysis.ipynb | gpl-3.0 | %matplotlib inline
"""
Explanation: DSLWP tracking file analysis
In this notebook, we analyse the tracking files published for DSLWP using GMAT. The tracking files contain a listing of the position and velocity of the spacecraft in ECEF coordinates for each second. For each tracking file, a GMAT script is generated us... |
Naereen/notebooks | agreg/public2012_D3.ipynb | mit | import numpy as np
import numpy.random as random
import matplotlib.pyplot as plt
"""
Explanation: Table des matières
1. Agrégation externe de mathématiques, texte d’exercice diffusé en 2012
1.1 Épreuve de modélisation, option informatique
1.2 Proposition d'implémentation, en Python 3
1.2.1 Pour [l'option informatique... |
dtherrick/dataviz_baseball | iPython/1-Create A Clean Chart.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
import pylab as pyl
# This is an example of an iPython magic command.
# If we don't use this, then we can't see our matplotlib plots in our notebook
%matplotlib inline
"""
Explanation: 1. Creating a Clean Chart
Begin by importing the packages we'll use.
End of expla... |
karlstroetmann/Artificial-Intelligence | Python/4 Automatic Theorem Proving/Knuth-Bendix-Algorithm.ipynb | gpl-2.0 | %run Parser.ipynb
t = parse_term('x * y * z')
t
to_str(t)
eq = parse_equation('i(x) * x = 1')
eq
to_str(parse_file('Examples/group-theory-1.eqn'))
"""
Explanation: The Knuth-Bendix Completion Algorithm
This notebook presents the Knuth-Bendix completion algorithm for transforming a set of equations into a confluent... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/10_recommend/content_based_preproc.ipynb | apache-2.0 | import os
import tensorflow as tf
import numpy as np
from google.cloud import bigquery
PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID
BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME
REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1
# do not change these
os.... |
milancurcic/lunch-bytes | Fall_2015/LB03/Python_lunchbytes_RSMAS.ipynb | cc0-1.0 | %pylab inline
from netCDF4 import Dataset
f = Dataset("http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NCDC/"
+".ERSST/.version4/.sst/dods")
f
temp = f.variables['sst']
temp
!cd /Users/lsiqueira/Desktop/python_lunchbytes
!ls -lh ersst_v4.nc
ifile = 'ersst_v4.nc'
f = Dataset(ifile)
temp = f.variables['sst... |
intel-analytics/BigDL | docs/docs/ClusterServingGuide/OtherFrameworkUsers/tf1-to-cluster-serving-example.ipynb | apache-2.0 | import tensorflow as tf
tf.__version__
"""
Explanation: In this example, we will use tensorflow v1 (version 1.15) to create a simple MLP model, and transfer the application to Cluster Serving step by step.
This tutorial is recommended for Tensorflow v1 user only. If you are not Tensorflow v1 user, the keras tutorial h... |
scottquiring/Udacity_Deeplearning | intro-to-rnns/Anna_KaRNNa_Exercises.ipynb | mit | import time
from collections import namedtuple
import re
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 netw... |
marioberges/F16-12-752 | projects/thongyi_weijian1/ipynb file/Project_1_thongyi_weijian1.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
%matplotlib inline
"""
Explanation: This ipython file is the project by Hongyi Tang and Weijian Li for course 12752.
There are four ipython files in the project in total. Each file consist of one cluster analysis task.
In this file, ... |
rddy/lentil | nb/synthetic_experiments.ipynb | apache-2.0 | num_students = 2000
num_assessments = 3000
num_ixns_per_student = 1000
USING_2PL = False # False => using 1PL
proficiencies = np.random.normal(0, 1, num_students)
difficulties = np.random.normal(0, 1, num_assessments)
if USING_2PL:
discriminabilities = np.random.normal(0, 1, num_assessments)
else:
discrimina... |
Santara/ML-MOOC-NPTEL | lecture1/ML-Anirban_Tutorial1.ipynb | gpl-3.0 | number_of_samples = 100
x = np.linspace(-np.pi, np.pi, number_of_samples)
y = 0.5*x+np.sin(x)+np.random.random(x.shape)
plt.scatter(x,y,color='black') #Plot y-vs-x in dots
plt.xlabel('x-input feature')
plt.ylabel('y-target values')
plt.title('Fig 1: Data for linear regression')
plt.show()
"""
Explanation: 1. Linear re... |
deepmind/optax | examples/quick_start.ipynb | apache-2.0 | import jax.numpy as jnp
import jax
import optax
import functools
"""
Explanation: Quickstart with Optax.
Optax is a simple optimization library for Jax. The main object is the GradientTransformation, which can be chained
with other transformations to obtain the final update operation and the optimizer state.
Optax als... |
yuanotes/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... |
rishuatgithub/MLPy | nlp/UPDATED_NLP_COURSE/00-Python-Text-Basics/02-Regular-Expressions.ipynb | apache-2.0 | text = "The agent's phone number is 408-555-1234. Call soon!"
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Regular Expressions
Regular Expressions (sometimes called regex for short) allow a user to search for strings using almost any sort of rule they can come up w... |
ArtyZaika/ml_spec | user_identification/user_identification.ipynb | gpl-3.0 | import warnings
warnings.filterwarnings('ignore')
from glob import glob
from datetime import datetime as dttime
import numpy as np
import pandas as pd
pd.set_option('display.max.columns', 25)
from scipy.sparse import csr_matrix
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.preproce... |
philippgrafendorfe/stackedautoencoders | ROBO_SAE.ipynb | mit | # modules
from keras.layers import Input, Dense, Dropout
from keras.models import Model
from keras.datasets import mnist
from keras.models import Sequential, load_model
from keras.optimizers import RMSprop
from keras.callbacks import TensorBoard
from __future__ import print_function
from keras.utils import plot_model
f... |
hetchkay/sg-judgments | data/data_wrangling.ipynb | mit | col_names = ['index', 'name', 'citation', 'author', 'number', 'date', 'court', 'coram', 'counsel', 'catchwords']
df = pd.read_table('raw.tsv', encoding='utf-8', header=None, names=col_names, index_col=0, parse_dates=True)
df.head()
"""
Explanation: Define the column names and read data from source file
End of explana... |
akloster/porekit-python | docs/01_Introduction.ipynb | isc | !ls /home/andi/nanopore/GenomeRU2/downloads/pass/ | tail -n 10
"""
Explanation: Introduction to Porekit-Python
Disclaimer
Porekit is the result of my personal interest in nanopore sequencing. I'm not affiliated with Oxford Nanopore Technologies, or any MAP participant. This means a lot of the factual information prese... |
mayankjohri/LetsExplorePython | Section 1 - Core Python/Chapter 01 - Introduction/01_04. Syntax.ipynb | gpl-3.0 | if True:
print("Welcome")
else:
print("Sayonara")
if True:
print("Guten Morgen!")
else:
print("Gute Nacht!")
"""
Explanation: Syntax and Style Guidlines
code is read much more often than it is written -- Guido's key insights
One of the main features of Python is properly formatted c... |
jhprinz/openpathsampling | examples/toy_model_mstis/toy_mstis_5_srtis.ipynb | lgpl-2.1 | %matplotlib inline
import openpathsampling as paths
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from openpathsampling.visualize import PathTreeBuilder, PathTreeBuilder
from IPython.display import SVG, HTML
def ipynb_visualize(movevis):
"""Default settings to show a movevis in an ipynb."... |
bt3gl/Machine-Learning-Resources | deep_art/deepdream/examples/dream.ipynb | gpl-2.0 | import os
import numpy as np
import scipy.ndimage as nd
import PIL.Image
from cStringIO import StringIO
from IPython.display import clear_output, Image, display
from google.protobuf import text_format
import caffe
# GPU support for CUDA and Caffe.
caffe.set_mode_gpu()
# Select GPU device if multiple devices exist.
ca... |
babebe/Yummly | Yummly_API/Yummly.ipynb | mit | # imports
import requests
import json
import pandas as pd
import numpy as np
# ID and Key
app_id = 'e2b9bebc'
app_key = '4193215272970d956cfd5384a08580a9'
"""
Explanation: Below done so far:
- access Yummly API with "Search Recipes API Call"
- search for "chicken" recipes
- convert JSON into dicts and lists with .j... |
ramseylab/networkscompbio | class08_components_python3_template.ipynb | apache-2.0 | from igraph import Graph
from igraph import summary
import pandas
import numpy
"""
Explanation: CS446/546 - Class Session 8 - Components
In this class session we are going to find the number of proteins that are in the giant component of the (undirected) protein-protein interaction network, using igraph.
End of explan... |
osmanbaskaya/meanval | meanval/tf-scratch.ipynb | mit | node1 = tf.constant(3.0, tf.float32)
node2 = tf.constant(4.0) # also tf.float32 implicitly
print(node1, node2)
sess = tf.Session()
print(sess.run([node1, node2]))
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
adder_node = a + b # + provides a shortcut for tf.add(a, b)
adder_node
sess.run(adder_node,... |
jamessdixon/Kaggle.HomeDepot | ProjectSearchRelevance.Python/Home Depot Product Search Relevance BM25.ipynb | mit | import graphlab as gl
from nltk.stem import *
"""
Explanation: Home Depot Product Search Relevance
The challenge is to predict a relevance score for the provided combinations of search terms and products. To create the ground truth labels, Home Depot has crowdsourced the search/product pairs to multiple human raters.
... |
quantopian/research_public | notebooks/data/quandl.ugid_infl_usa/notebook.ipynb | apache-2.0 | # import the dataset
from quantopian.interactive.data.quandl import ugid_infl_usa
# Since this data is public domain and provided by Quandl for free, there is no _free version of this
# data set, as found in the premium sets. This import gets you the entirety of this data set.
# import data operations
from odo import ... |
ye-kyaw-thu/sylbreak | jupyter-notebook/using-sylbreak-in-jupyter-notebook.ipynb | apache-2.0 | # Regular Expression Python Library ကို သုံးလို့ရအောင် import လုပ်တာ
import re
# စာလုံးတွေကို အုပ်စုဖွဲ့တာ (သို့) variable declaration လုပ်တာ
# တကယ်လို့ syllable break လုပ်တဲ့ အခါမှာ မြန်မာစာလုံးချည်းပဲ သပ်သပ် လုပ်ချင်တာဆိုရင် enChar က မလိုပါဘူး
myConsonant = "က-အ"
enChar = "a-zA-Z0-9"
otherChar = "ဣဤဥဦဧဩဪဿ၌၍၏၀-၉၊။!-/... |
walkon302/CDIPS_Recommender | notebooks/.ipynb_checkpoints/07282017_todo_CDIPS-checkpoint.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import os
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
os.chdir('/Users/Walkon302/Desktop/deep-learning-models-master/view2buy')
# Read the preprocessed file, containing the user profile and item features from view2buy folder
df = pd.read_pickle('user_... |
ddcampayo/ddcampayo.github.io | cursos_previos/Curso_CFD_OS_2019/notebooks/conveccion_reading.ipynb | gpl-3.0 | %matplotlib inline
import scipy as np
from matplotlib import pyplot as plt
"""
Explanation: Convección en una dimensión
End of explanation
"""
data = np.loadtxt('initial_f.csv' , delimiter=',' )
x = data[ : , 0 ]
u0 = data[ : , 1 ]
L = x[-1] - x[0] # longitud del sistema 1D
nx = x.size # nodos es... |
jeroarenas/MLBigData | 3_TopicModeling/TM1_NLP_student.ipynb | mit | %matplotlib inline
# Required imports
from wikitools import wiki
from wikitools import category
import nltk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import gensim
import numpy as np
import lda
import lda.datasets
import matplotlib.pyplot as p... |
google-aai/tf-serving-k8s-tutorial | jupyter/estimator_training_to_serving_solution.ipynb | apache-2.0 | import numpy as np
import os
import tensorflow as tf
import urllib.request
# Define a constant indicating the number of layers in our loaded model. We're loading a
# resnet-50 model.
RESNET_SIZE = 50
# Model and serving directories
MODEL_DIR="resnet_model_checkpoints"
SERVING_DIR="estimator_servable"
SAMPLE_DIR=".... |
mayukh18/reco | examples/FM_example.ipynb | mit | import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from reco.datasets import loadMovieLens100k
from reco.recommender import FM
"""
Explanation: Factorization Machine example
End of explanation
"""
train, test, _, _ = loadMovieLens100k(train_test_split=True)
print(train.head())
"""... |
pucdata/pythonclub | sessions/09-numba_cython/Faster_computations.ipynb | gpl-3.0 | import numpy as np
print "export CFLAGS=\"-I",np.__path__[0]+'/core/include/ $CFLAGS\"'
"""
Explanation: Prerequisites
In order to run these examples, it is recommended to use gcc as the default compiler, with OpenMP installed.
Numba and Cython can be installed easily with conda:
conda install numba
conda install cyth... |
MIT-LCP/mimic-code | mimic-iii/notebooks/aline/aline.ipynb | mit | from __future__ import print_function
# Import libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import psycopg2
import os
# below is used to print out pretty pandas dataframes
from IPython.display import display, HTML
%matplotlib inline
def execute_query_safely(sql, con):
cur = c... |
balarsen/pymc_learning | Counting/Dead Time corrections.ipynb | bsd-3-clause | %matplotlib inline
from pprint import pprint
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pymc3 as mc
import spacepy.toolbox as tb
import spacepy.plot as spp
import tqdm
from scipy import stats
import seaborn as sns
sns.set(font_scale=1.5)
# matplotlib.pyplot.rc('fig... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_dfnp/td1a_cenonce_session_10.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.data - DataFrame et Matrice
Les DataFrame se sont imposés pour manipuler les données avec le module pandas. Le module va de la manipulation des données jusqu'au calcul d'une régresion linéaire.
Avec cette façon de représenter les donné... |
AEW2015/PYNQ_PR_Overlay | Pynq-Z1/notebooks/examples/opencv_filters_hdmi.ipynb | bsd-3-clause | from pynq import Overlay
Overlay("base.bit").download()
"""
Explanation: OpenCV Filters HDMI
In this notebook, several filters will be applied to HDMI input images.
Those input sources and applied filters will then be displayed either directly in the notebook or on HDMI output.
To run all cells in this notebook a HDMI... |
quantopian/research_public | notebooks/lectures/Position_Concentration_Risk/notebook.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Position Concentration Risk
By Maxwell Margenot and Delaney Granizo-Mackenzie.
Part of the Quantopian Lecture Series:
www.quantopian.com/lectures
github.com/quantopian/research_public
When trading, it is important to diversify you... |
Peter9192/MAQ_PhD | Python/Weathermap_demo.ipynb | mit | # Required package
from IPython.display import Image
weblink = 'http://cdn.knmi.nl/knmi/map/page/klimatologie/daggegevens/weerkaarten/analyse_2012052812.gif'
Image(url=weblink)
"""
Explanation: Interactively rendering weather maps from the KNMI database
Peter Kalverla, March 2016
In the process of analysing any kind ... |
StingraySoftware/notebooks | Crossspectrum/Crossspectrum_tutorial.ipynb | mit | import numpy as np
from stingray import Lightcurve, Crossspectrum, AveragedCrossspectrum
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
%matplotlib inline
font_prop = font_manager.FontProperties(size=16)
"""
Explanation: Cross Spectra
This tutorial shows how to make and manipulate a cr... |
shunw/pythonML_code | ch07.ipynb | mit | %load_ext watermark
%watermark -a 'Sebastian Raschka' -u -d -v -p numpy,pandas,matplotlib,scipy,sklearn
"""
Explanation: Copyright (c) 2015, 2016 Sebastian Raschka
https://github.com/rasbt/python-machine-learning-book
MIT License
Python Machine Learning - Code Examples
Chapter 7 - Combining Different Models for Ensemb... |
hpparvi/PyTransit | notebooks/example_qpower2_model.ipynb | gpl-2.0 | %pylab inline
sys.path.append('..')
from pytransit import QPower2Model
seed(0)
times_sc = linspace(0.85, 1.15, 1000) # Short cadence time stamps
times_lc = linspace(0.85, 1.15, 100) # Long cadence time stamps
k, t0, p, a, i, e, w = 0.1, 1., 2.1, 3.2, 0.5*pi, 0.3, 0.4*pi
pvp = tile([k, t0, p, a, i, e, w], (50,... |
turbomanage/training-data-analyst | blogs/ncaa/ncaa_feateng.ipynb | apache-2.0 | %%bigquery df1
SELECT
team_code,
AVG(SAFE_DIVIDE(fgm + 0.5 * fgm3,fga)) AS offensive_shooting_efficiency,
AVG(SAFE_DIVIDE(opp_fgm + 0.5 * opp_fgm3,opp_fga)) AS opponents_shooting_efficiency,
AVG(win) AS win_rate,
COUNT(win) AS num_games
FROM lab_dev.team_box
WHERE fga IS NOT NULL
GROUP BY team_code
"""
Expl... |
xiamike/cgt | examples/tutorial.ipynb | mit | import cgt
a = cgt.scalar(name='a') # float-valued scalar, with optional name provided
b = cgt.scalar(name='b')
n = cgt.scalar(name='n', dtype='int64') # integer scalar
"""
Explanation: The basic workflow for using CGT is as follows.
1.) Define symbolic variables
End of explanation
"""
c = (a**n + b**n)**(1.0/n)
""... |
spohnan/geowave | examples/data/notebooks/jupyter/geowave-spatial-join.ipynb | apache-2.0 | #!pip install --user --upgrade pixiedust
#Stop old session
spark.stop()
"""
Explanation: GeoWave Spatial Join Demo
This demo runs a distance join using an GPX dataset for Germany and the GDELT dataset. We use this demo to run a distance join using our tiered join algorithm on two large datasets to get what GPX points... |
ljishen/BSFD | playbook/bench/visualize.ipynb | mit | sysbench_cpu_df = plot_hist(category_name='sysbench_cpu', yscale='log',
xmargin=0.1 , tick_rotation='vertical',
xlabel='Maximum prime number', ylabel='Elapsed time (sec)')
sysbench_cpu_df
"""
Explanation: SysBench: CPU performance test
When running with the CPU w... |
rknLA/pd-blosc | notebook/01-MinBLEP-Generator.ipynb | mit | pylab inline
from itertools import izip
"""
Explanation: Python MinBLEP Generator
An iPython port of the MinBLEP generator from experimentalscene
This notebook takes a bottom-up approach to reconstructing the algorithms described there, and uses numpy where possible (most notably for sinc, fft/ifft, and automagically... |
UWPRG/Python | tools/metad_converge/MetaD converge.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import glob
import os
from matplotlib.patches import Rectangle
# define all variables for convergence script
# these will pass to the bash magic below used to call plumed sum_hills
dir="MetaD_converge" #where the intermediate fes will be stored
hills="other/HILLS" ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.