repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
recepkabatas/Spark | 2_fullyconnected.ipynb | apache-2.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
import cPickle as pickle
import numpy as np
import tensorflow as tf
"""
Explanation: Deep Learning with TensorFlow
Credits: Forked from TensorFlow by Google
Setup
Refer to the setup instructions.
Exercise 2
Pre... |
jamesfolberth/NGC_STEM_camp_AWS | notebooks/machineLearning_notebooks/03_Optimization/04_Stochastic_Gradient_Ascent.ipynb | bsd-3-clause | plotsurface()
"""
Explanation: Lecture 4: Stochastic Gradient Ascent
<img src="figs/mountains.jpg",width=1100,height=50>
Note: There are several large Helper Functions at the bottom of the notebook. Scroll down and execute those cells before you continue.
<br>
<br>
The Learning Rate Schedule Game
In the case when ... |
saashimi/code_guild | interactive-coding-challenges/graphs_trees/bst_validate/bst_validate_challenge.ipynb | mit | %run ../bst/bst.py
%load ../bst/bst.py
def validate_bst(node):
# TODO: Implement me
pass
"""
Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small>
Challenge Notebook
Problem: Determine if a tree is a valid binary search tree.
Constraints
Test Cas... |
davidthomas5412/PanglossNotebooks | MassInferencePanglossPerformance.ipynb | mit | from pangloss import BackgroundCatalog, ForegroundCatalog, \
TrueHaloMassDistribution, Kappamap, Shearmap
ITERATIONS = 4
RADIUS = 2.0
# initialize background and foreground
B = BackgroundCatalog(N=10.0, domain=[1.5, 1.4, -1.5, -1.4], field=[0, 0, 0, 0])
F = ForegroundCatalog.guo()
F.set_mass_prior(TrueHaloMassDis... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/Filter.ipynb | apache-2.0 | #First let's make a function
def even_check(num):
if num%2 ==0:
return True
"""
Explanation: filter
The function filter(function, list) offers a convenient way to filter out all the elements of an iterable, for which the function returns True.
The function filter(function(),l) needs a function as its firs... |
mne-tools/mne-tools.github.io | 0.23/_downloads/09baca5bff98c3be2834792aebba565c/montage_sgskip.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD Style.
import os.path as op
import mne
from mne.channels.montage import get_builtin_montages
from mne.datasets import fetch_fsaverage
from mne.viz import set_3d_title, set_3d_view
"""
Explanation:... |
atcemgil/notes | matkoy2021-1.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
from __future__ import print_function
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
import matplotlib.pylab as plt
from IPython.display import clear_output, display, HTML
x = np.array([8.0 , 6.1 , 11., 7., 9., ... |
ES-DOC/esdoc-jupyterhub | notebooks/cccma/cmip6/models/sandbox-1/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cccma', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: CCCMA
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (4... |
pfschus/fission_bicorrelation | analysis/Cf072115_to_Cf072215b/create_bhp_nn_1ns.ipynb | mit | import os
import sys
import matplotlib.pyplot as plt
import matplotlib.colors
import numpy as np
import imageio
import scipy.io as sio
sys.path.append('../../scripts/')
import bicorr as bicorr
import bicorr_plot as bicorr_plot
%load_ext autoreload
%autoreload 2
"""
Explanation: Analysis of combined data sets Cf0721... |
4dsolutions/Python5 | Euler's Formula Using Tau.ipynb | mit | from math import e, pi as π
τ = 2 * π
i = 1j
result = e ** (i * τ)
print ("{:1.5f}".format(result.real))
"""
Explanation: Thanks to unicode, we may use Greek letters directly in our code.
In this Jupyter Notebook, lets use θ (theta), π (pi) and τ (tau) with τ = 2 * π.
Then we'll plot the graph of Euler's Formula, ... |
t-silvers/supreme-robot | TCGA_OV_exp-cn_jointplot.ipynb | mit | import xenaPython as xena
import seaborn as sns
import numpy as np
import scipy as scipy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
plt.rcParams.update({'figure.max_open_warning': 0})
import rpy2
%matplotlib inline
%load_ext rpy2.ipython
def accessXenaData(hub, data_set):
samples = ... |
nproctor/phys202-project | project/Morse Net Part 4.ipynb | mit | import NeuralNetImport as NN
import numpy as np
import NNpix as npx
from IPython.display import Image
"""
Explanation: Morse Code Neural Net
I created a text file that has the entire alphabet of numerical morse code. Meaning, "." is represented by the number "0.5" and "-" is represented by "1.0". This neural net is tr... |
anhquan0412/deeplearning_fastai | deeplearning1/nbs/lesson4.ipynb | apache-2.0 | ratings = pd.read_csv(path+'ratings.csv')
ratings.head()
len(ratings)
"""
Explanation: Set up data
We're working with the movielens data, which contains one rating per row, like this:
End of explanation
"""
movie_names = pd.read_csv(path+'movies.csv').set_index('movieId')['title'].to_dict
users = ratings.userId.un... |
tpin3694/tpin3694.github.io | machine-learning/.ipynb_checkpoints/adding_and_subtracting_matrices-checkpoint.ipynb | mit | # Load library
import numpy as np
"""
Explanation: Title: Adding And Subtracting Matrices
Slug: adding_and_subtracting_matrices
Summary: How to add and subtract matrices in Python.
Date: 2017-09-03 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
Preliminaries
End of explanati... |
kunbud1989/scraping-google-news-indonesia | 2_Scraping_Content_Publisher_News_Indonesia.ipynb | mit | from goose import Goose
from pprint import pprint
import string
import datetime
class scrap_news(object):
def __init__(self, url):
self.url = url
def scrap_publisher_news(self):
g = Goose(
{
# 'browser_user_agent': 'Opera/9.80 (Android; Opera Mini/8.0.1807/36... |
gully/adrasteia | notebooks/adrasteia_05-02_DR2_variability_catalog_exploratory.ipynb | mit | # %load /Users/obsidian/Desktop/defaults.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
! du -hs ../data/dr2/Gaia/gdr2/vari_classifier_result/csv
df0 = pd.read_csv('../data/dr2/Gaia/gdr2/vari_classifier_result/csv/VariClassif... |
banyh/ShareIPythonNotebook | NLP_With_Python/Ch4.ipynb | gpl-3.0 | a = list('hello') # a指向一個list物件
b = a # b指向a所指向的list物件
b[3] = 'x' # 改變物件第3個元素,因為實際件只有一個,所以a,b看到的物件會同時改變
a, b
a = ['maybe']
b = [a, a, a]
b
a[0] = 'will'
b
"""
Explanation: Ch4 Writing Structured Programs
Assignments
End of explanation
"""
a = ['play']
b = a[:]
a[0] = 'zero'
a, b
a = ['play']... |
Pittsburgh-NEH-Institute/Institute-Materials-2017 | schedule/week_2/Tokenization.ipynb | gpl-3.0 | from collatex import *
"""
Explanation: Tokenization
Default tokenization
Tokenization (the first of the five parts of the Gothenburg model) divides the texts to be collated into tokens, which are most commonly (but not obligatorily) words. By default CollateX considers punctuation to be its own token, which means tha... |
ktmud/deep-learning | gan_mnist/Intro_to_GANs_Solution.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... |
beangoben/HistoriaDatos_Higgs | Dia2/6_Datos_Iris.ipynb | gpl-2.0 | import pandas as pd
import numpy as np # modulo de computo numerico
import matplotlib.pyplot as plt # modulo de graficas
# esta linea hace que las graficas salgan en el notebook
import seaborn as sns
%matplotlib inline
"""
Explanation: Classificando Iris
Ahora vamos a ver un conjunto de datos muy famosos, los datos ir... |
jmankoff/data | Assignments/networks-byte6/.ipynb_checkpoints/byte6-SN-checkpoint.ipynb | gpl-3.0 | import copy
# open the file you have downloaded
# these files are organized
file = open("amazon.txt")
# this returns an array with one entry for each line ni the file
lines = file.readlines()
print len(lines)
# Note: the format of the snap files is to list a node (identified by a unique number)
# and all of the nodes... |
mne-tools/mne-tools.github.io | dev/_downloads/23237b92405a4b223d89222e217ffffd/morph_volume_stc.ipynb | bsd-3-clause | # Author: Tommy Clausner <tommy.clausner@gmail.com>
#
# License: BSD-3-Clause
import os
import nibabel as nib
import mne
from mne.datasets import sample, fetch_fsaverage
from mne.minimum_norm import apply_inverse, read_inverse_operator
from nilearn.plotting import plot_glass_brain
print(__doc__)
"""
Explanation: Mo... |
JKarathiya/Lean | Research/KitchenSinkQuantBookTemplate.ipynb | apache-2.0 | # Load in our startup script, required to set runtime for PythonNet
%run ../start.py
# Create an instance of our QuantBook
qb = QuantBook()
"""
Explanation: Welcome to The QuantConnect Research Page
Refer to this page for documentation https://www.quantconnect.com/docs/research/overview
Contribute to this template fi... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mpi-m', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: MPI-M
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Propertie... |
keras-team/keras-io | examples/vision/ipynb/conv_lstm.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import io
import imageio
from IPython.display import Image, display
from ipywidgets import widgets, Layout, HBox
"""
Explanation: Next-Frame Video Prediction with Convolutional ... |
empet/Math | Imags/Animating a family-of-complex-functions.ipynb | bsd-3-clause | import plotly.graph_objects as go
import numpy as np
Plotly version of the HSV colorscale, corresponding to S=1, V=1, where S is saturation and V is the value.
pl_hsv = [[0.0, 'rgb(0, 255, 255)'],
[0.0833, 'rgb(0, 127, 255)'],
[0.1667, 'rgb(0, 0, 255)'],
[0.25, 'rgb(127, 0, 255)'],
[0.3333, 'rgb(255, 0, 255)'],
... |
MJuddBooth/pandas | doc/source/user_guide/style.ipynb | bsd-3-clause | import matplotlib.pyplot
# We have this here to trigger matplotlib's font cache stuff.
# This cell is hidden from the output
import pandas as pd
import numpy as np
np.random.seed(24)
df = pd.DataFrame({'A': np.linspace(1, 10, 10)})
df = pd.concat([df, pd.DataFrame(np.random.randn(10, 4), columns=list('BCDE'))],
... |
csaladenes/blog | airports/airportia_jo_dest_parser.ipynb | mit | for i in locations:
print i
if i not in sch:sch[i]={}
#march 11-24 = 2 weeks
for d in range (11,25):
if d not in sch[i]:
try:
url=airportialinks[i]
full=url+'departures/201703'+str(d)
m=requests.get(full).content
sch[i][... |
drericstrong/Blog | 20170419_BootstrappingTheCentralLimitTheorem.ipynb | agpl-3.0 | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
# Read the data and plot a histogram
df = pd.read_csv('20170419_data_bootstrap.csv', header=None)
df.hist()
plt.title('Data from Unknown Distribution')
plt.xlabel('Value');
"""
Explanation: Continuing on the previous blog post, this post will demon... |
tsarouch/data_science_references_python | regression/regression_tree_and_max_depth.ipynb | gpl-2.0 | import sklearn.datasets as datasets
import pandas as pd
iris=datasets.load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
df.head(2)
"""
Explanation: Regression based on Iris dataset
We ll use the Iris dataset in the regression setup
- not use the target variable (typicall classification case)
- use ... |
JKeun/project-02-watcha | 01_crawling/05_additional_feature(raw_df2, lee_df).ipynb | mit | import requests
from bs4 import BeautifulSoup
import json
import pandas as pd
url_df = pd.read_csv('./resource/url_df.csv')
url_df
for title in url_df['title_url']:
print(title)
url_df[400:]
"""
Explanation: title_url 돌려 feature 뽑기
End of explanation
"""
df1 = pd.DataFrame(columns=['DESC', '감독', '배우', '평가자수',... |
flohorovicic/pynoddy | docs/notebooks/Likelihood_extraction.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
import sys, os
import matplotlib.pyplot as plt
# adjust some settings for matplotlib
from matplotlib import rcParams
# print rcParams
rcParams['font.size'] = 15
# determine path of repository to set paths corretly below
rep... |
BONSAMURAIS/bonsai | legacy-examples/Correspondences_table_example_1.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
"""
Explanation: Example on the use of correspondence tables
In this simple example it is shown how a vector classified according to one classification is converted into another classification
The first classification has four categories: A, B, C, D
The second classification has... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/hadgem3-gc31-hh/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'hadgem3-gc31-hh', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NERC
Source ID: HADGEM3-GC31-HH
Topic: Ocean
Sub-Topics: Timestepping Framewor... |
turbomanage/training-data-analyst | CPB100/lab4a/demandforecast2.ipynb | apache-2.0 | !sudo pip install --user pandas-gbq
!pip install --user pandas_gbq
"""
Explanation: <h1>Demand forecasting with BigQuery and TensorFlow</h1>
In this notebook, we will develop a machine learning model to predict the demand for taxi cabs in New York.
To develop the model, we will need to get historical data of taxicab ... |
CELMA-project/CELMA | MES/boundaries/2-uEParSheath/calculations/exactSolutions.ipynb | lgpl-3.0 | %matplotlib notebook
from sympy import init_printing
from sympy import S
from sympy import sin, cos, tanh, exp, pi, sqrt, log
from boutdata.mms import x, y, z, t
from boutdata.mms import DDX
import os, sys
# If we add to sys.path, then it must be an absolute path
common_dir = os.path.abspath('./../../../../common')
... |
metpy/MetPy | v0.8/_downloads/Hodograph_Inset.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import numpy as np
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, Hodograph, SkewT
from metpy.units import units
"""
Explanation: Hodograph Inset
... |
stevetjoa/stanford-mir | energy.ipynb | mit | x, sr = librosa.load('audio/simple_loop.wav')
sr
x.shape
librosa.get_duration(x, sr)
"""
Explanation: ← Back to Index
Energy and RMSE
The energy (Wikipedia of a signal corresponds to the total magntiude of the signal. For audio signals, that roughly corresponds to how loud the signal is. The energy in a signal... |
bjshaw/phys202-project | galaxy_project/Ia) Base Question Implementation.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from initial_velocities import velocities_m, velocities_S
from DE_solver import derivs, equationsolver
"""
Explanation: Base Question Implementation
End of explanation
"""
ic_base = np.zeros(484)
"""
Explanatio... |
shengshuyang/StanfordCNNClass | assignment1/knn.ipynb | gpl-3.0 | # Run some setup code for this notebook.
import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the notebook
# rather than in a new window.
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.... |
ML4DS/ML4all | NLP2.Spacy_Tutorial (Data Preprocessing)/spaCy_tutorial_students.ipynb | mit | # Common imports
import numpy as np
import pandas as pd
import zipfile as zp
from termcolor import colored
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
#To wrap long text lines
from IPython.display import HTML, display
def set_css():
disp... |
rainyear/pytips | Tips/2016-03-28-Heap-and-Queue.ipynb | mit | import heapq
print(heapq.__all__)
"""
Explanation: Python 的堆与优先队列
Python 中内置的 heapq 库和 queue 分别提供了堆和优先队列结构,其中优先队列 queue.PriorityQueue 本身也是基于 heapq 实现的,因此我们这次重点看一下 heapq。
堆(Heap)是一种特殊形式的完全二叉树,其中父节点的值总是大于子节点,根据其性质,Python 中可以用一个满足 heap[k] <= heap[2*k+1] and heap[k] <= heap[2*k+2] 的列表来实现(heapq 也确实是这么做的)。堆可以用于实现调度器(例... |
kyclark/metagenomics-book | python/consensus/consensus.ipynb | gpl-3.0 | import pandas as pd
from collections import Counter
seqs = ['TCGGGGGTTTTT',
'CCGGTGACTTAC',
'ACGGGGATTTTC',
'TTGGGGACTTTT',
'AAGGGGACTTCC',
'TTGGGGACTTCC',
'TCGGGGATTCAT',
'TCGGGGATTCCT',
'TAGGGGACCTAC',
'TCGGGTATAACC']
data = {}
for i, seq ... |
napsternxg/GET17_SNA | notebooks/NetworkX.ipynb | gpl-3.0 | %matplotlib inline
from operator import itemgetter
import networkx as nx
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
from io import StringIO
import pydotplus
from IPython.display import SVG, display
sns.set_context("poster")
sns.set_style("ticks")
DATA_DI... |
icrtiou/coursera-ML | ex4-NN back propagation/2- the cost function.ipynb | mit | %reload_ext autoreload
%autoreload 2
import sys
sys.path.append('..')
from helper import nn
from helper import logistic_regression as lr
import numpy as np
"""
Explanation: note
Didn't mean to generalize NN here. Just plow through this 400>25>10 setup to get the feeling of NN
End of explanation
"""
X_raw, y... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mpi-m', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: MPI-M
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Emission... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160524화_7일차_기초 확률론 3 - 확률 모형 Probability Models(단변수 분포)/2.이항 확률 분포.ipynb | mit | N = 10
theta = 0.6
rv = sp.stats.binom(N, theta)
rv
"""
Explanation: 이항 확률 분포
베르누이 시도(Bernoulli trial)란 성공 혹은 실패로 결과가 나오는 것을 말한다.
성공확률이 $\theta$ 인 베르누이 시도를 $N$번 하는 경우를 생각해 보자. 가장 운이 좋을 때에는 $N$번 모두 성공할 것이고 가장 운이 나쁜 경우에는 한 번도 성공하지 못할 것이다. $N$번 중 성공한 횟수를 확률 변수 $X$ 라고 한다면 $X$의 값은 0 부터 $N$ 까지의 정수 중 하나가 될 것이다.
이러한 확률 변수를 ... |
Agent007/deepchem | examples/notebooks/protein_ligand_complex_notebook.ipynb | mit | %load_ext autoreload
%autoreload 2
%pdb off
# set DISPLAY = True when running tutorial
DISPLAY = False
# set PARALLELIZE to true if you want to use ipyparallel
PARALLELIZE = False
import warnings
warnings.filterwarnings('ignore')
import deepchem as dc
from deepchem.utils import download_url
import os
download_url("h... |
szitenberg/ReproPhyloVagrant | notebooks/Tutorials/Basic/3.7 Alignment trimming.ipynb | mit | from reprophylo import *
pj = unpickle_pj('./outputs/my_project.pkpj',
git=False)
"""
Explanation: This section starts with a Project that already contains alignments:
End of explanation
"""
pj.alignments.keys()
"""
Explanation: If we call the keys of the pj.alignments dictionary, we can see the na... |
openfisca/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/examples/notebooks/depenses_ticpe_carburants_par_decile.ipynb | agpl-3.0 | from __future__ import division
import pandas
import seaborn
from pandas import concat
"""
Explanation: Cet exemple a pour objectif de décrire pour chaque décile de revenu la consommation annuelle moyenne de carburants, ainsi que les dépenses moyennes pour la TICPE
Import de modules généraux
End of explanation
"""
... |
rscohn2/IntelPythonExamples | notebooks/Cython Example.ipynb | mit | %load_ext cython
import array
a = array.array('l',range(100))
s = 0
"""
Explanation: This notebook uses cython, which requires a C compiler. Linux comes with a compiler. Install xcode for OSX and Visual Studio for windows.
End of explanation
"""
def python_sum(a):
global s
s = 0
for i in range(len(a)):
... |
tensorflow/docs-l10n | site/ja/hub/tutorials/cord_19_embeddings_keras.ipynb | apache-2.0 | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
necromuralist/student_intervention | student_intervention/student_intervention_stratified.ipynb | mit | # Import libraries
import numpy as np
import pandas as pd
# additional imports
import matplotlib.pyplot as plot
import seaborn
from sklearn.cross_validation import train_test_split
%matplotlib inline
RANDOM_STATE = 100
REPETITIONS = 1
RUN_PLOTS = True
# Read student data
student_data = pd.read_csv("student-data.csv"... |
tbphu/fachkurs_bachelor | packages/plotting/plotting.ipynb | mit | %matplotlib inline
import numpy as np # we will need numpy
import matplotlib.pyplot as plt # and this is for plotting
"""
Explanation: Plotting in Python
Python does not have built in plotting capabilities, but there is a plethora of useful packages specialized to all kinds of pl... |
jedbrown/numerical-computation | Rootfinding.ipynb | mit | %matplotlib notebook
from matplotlib import pyplot
import numpy
tests = []
@tests.append
def f0(x):
return x*x - 2, 2*x
@tests.append
def f1(x):
return numpy.cos(x) - x, -numpy.sin(x) - 1
@tests.append
def f2(x):
return numpy.exp(-numpy.abs(x)) + numpy.sin(x), numpy.exp(-numpy.abs(x))*(-numpy.sign(x)) +... |
projectappia/eegnet | src/ipynb/create_TFRecords.ipynb | mit | import shutil
# Read files list. Header: file, class (0: interictal, 1: preictal), safe (or not to use)
files_list = np.genfromtxt('./train_and_test_data_labels_safe.csv',
dtype=("|S15", np.int32, np.int32), delimiter=',', skip_header=1)
# Get only files which are safe to use
files_list = ... |
ian-andrich/linear-algebra-crash-course | Notebooks/02_Inverse_Matrix_Theorem.ipynb | gpl-3.0 | import numpy as np
import numpy.linalg as la
A = np.array(range(1,5)).reshape(2,2)
determinant_A = la.det(A)
print(A)
print("Determinant is: {}".format(determinant_A)) # Notice the rounding error.
"""
Explanation: The inverse Matrix Theorem
The inverse matrix theorem is a statement about a number of equivalent condi... |
dmytroKarataiev/MachineLearning | boston_housing/boston_housing.ipynb | mit | # Import libraries necessary for this project
import numpy as np
import pandas as pd
import visuals as vs # Supplementary code
from sklearn.cross_validation import ShuffleSplit
# Pretty display for notebooks
%matplotlib inline
# Load the Boston housing dataset
data = pd.read_csv('housing.csv')
prices = data['MDEV']
f... |
paulbrodersen/netgraph | docs/source/sphinx_gallery_output/plot_14_bipartite_layout.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
from netgraph import Graph
edges = [
(0, 1),
(1, 2),
(2, 3),
(3, 4),
(5, 6)
]
Graph(edges, node_layout='bipartite', node_labels=True)
plt.show()
"""
Explanation: Bipartite node layout
By default, nodes are partitioned into two subsets using a two-coloring of the ... |
liulixiang1988/documents | Python数据科学101.ipynb | mit | %matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 3*np.pi, 500)
plt.plot(x, np.sin(x**2))
plt.title('Sine wave')
"""
Explanation: Python数据科学101
1. 配置系统
Python
JDK
创建C:\Hadoop\bin
在这里下载windows版的hadoop https://github.com/steveloughran/winutils 拷贝winutils到C:\Had... |
gatmeh/Udacity-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... |
csaladenes/blog | airports/airportia_hu_arrv_parser.ipynb | mit | for i in locations:
print i
if i not in sch:sch[i]={}
#march 11-24 = 2 weeks
for d in range (11,25):
if d not in sch[i]:
try:
url=airportialinks[i]
full=url+'arrivals/201703'+str(d)
m=requests.get(full).content
sch[i][fu... |
marcotcr/lime | doc/notebooks/Tutorial - Image Classification Keras.ipynb | bsd-2-clause | import os
import keras
from keras.applications import inception_v3 as inc_net
from keras.preprocessing import image
from keras.applications.imagenet_utils import decode_predictions
from skimage.io import imread
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
print('Notebook run using keras:', kera... |
zzsza/Datascience_School | 06. 기초 선형대수/05. 행렬의 연산과 성질.ipynb | mit | A = (np.arange(9) - 4).reshape((3, 3))
A
np.linalg.norm(A)
"""
Explanation: 행렬의 연산과 성질
행렬에는 곱셈, 전치 이외에도 지수 함수 등의 다양한 연산을 정의할 수 있다. 각각의 정의와 성질을 알아보자.
행렬의 부호
행렬은 복수의 실수 값을 가지고 있으므로 행렬 전체의 부호는 정의할 수 없다. 하지만 행렬에서도 실수의 부호 정의와 유사한 기능을 가지는 정의가 존재한다. 바로 행렬의 양-한정(positive definite) 특성이다. (정방행렬에 한정됨)
쿼드라틱 Form의 결과는 실수값
모든 실수 ... |
Naereen/notebooks | Test_for_Binder__access_local_packages.ipynb | mit | import sys
print("Path (sys.path):")
for f in sys.path:
print(f)
import os
print("Current directory:")
print(os.getcwd())
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Test-for-Binder-v2" data-toc-modified-id="Test-for-Binder-v2-1"><span class="toc-item-num">1 </span>Test... |
deepchem/deepchem | examples/tutorials/Learning_Unsupervised_Embeddings_for_Molecules.ipynb | mit | !pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Learning Unsupervised Embeddings for Molecules
In this tutorial, we will use a SeqToSeq model to generate fingerprints for classifying molecules. This is based on the following paper, although some of the implementation details are diff... |
tensorflow/workshops | tfx_airflow/notebooks/step4.ipynb | apache-2.0 | from __future__ import print_function
import os
import tempfile
import pandas as pd
import tensorflow as tf
import tensorflow_transform as tft
from tensorflow_transform import beam as tft_beam
import tfx_utils
from tfx.utils import io_utils
from tensorflow_metadata.proto.v0 import schema_pb2
# For DatasetMetadata bo... |
probml/pyprobml | notebooks/book1/19/finetune_cnn_torch.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
np.random.seed(seed=1)
import math
import os
try:
import torch
except ModuleNotFoundError:
%pip install -qq torch
import torch
from torch import nn
from torch.nn import functional as F
try:
import torchvision
except ModuleNotFoundError:
%pip inst... |
intellimath/pyaxon | examples/axon_object_serialization.ipynb | mit | from __future__ import print_function, unicode_literals
from axon.api import loads, dumps
from IPython.display import HTML, display
"""
Explanation: This post continue series about AXON and pyaxon. Now we consider some examples of object serialization/deserialization.
<!-- TEASER_END -->
End of explanation
"""
text ... |
neuro-data-science/neuro_data_science | python/modeling/linear_models_and_bootstrapping.ipynb | gpl-3.0 | import sys
sys.path.append('../src/')
import opencourse as oc
import numpy as np
import scipy.stats as stt
import matplotlib.pyplot as plt
import pandas as pd
from scipy import polyfit
from scipy.ndimage.filters import gaussian_filter1d
%matplotlib inline
# Below we'll plot the PDF of a normal distribution.
mean, std... |
graphistry/pygraphistry | demos/more_examples/simple/tutorial_csv_mini_app_icij_implants.ipynb | bsd-3-clause | #!pip install graphistry -q
import pandas as pd
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: V... |
manoharan-lab/structural-color | structure_factor_data.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import structcol as sc
import structcol.refractive_index as ri
from structcol import montecarlo as mc
from structcol import detector as det
from structcol import model
from structcol import structure
%matplotlib inline
"""
Explanation: Tutorial for using structure fac... |
mitdbg/modeldb | client/workflows/demos/composite-model.ipynb | mit | try:
import verta
except ImportError:
!pip install verta
HOST = "app.verta.ai"
# import os
# os.environ['VERTA_EMAIL'] =
# os.environ['VERTA_DEV_KEY'] =
"""
Explanation: Logistic Regression with Preprocessing
This example demonstrates how to call one deployed endpoint from another.
In this scenario, two pr... |
metpy/MetPy | v0.6/_downloads/Point_Interpolation.ipynb | bsd-3-clause | import cartopy
import cartopy.crs as ccrs
from matplotlib.colors import BoundaryNorm
import matplotlib.pyplot as plt
import numpy as np
from metpy.cbook import get_test_data
from metpy.gridding.gridding_functions import (interpolate, remove_nan_observations,
remove_repeat... |
mssalvador/Fifa2018 | Teknisk Tirsdag Tutorial (Supervised Learning).ipynb | apache-2.0 | # Run the datacleaning notebook to get all the variables
%run 'Teknisk Tirsdag - Data Cleaning.ipynb'
"""
Explanation: Teknisk Tirsdag: Supervised Learning
I denne opgave skal vi bruge Logistisk Regression til at forudsige hvilke danske fodboldspillere der egentlig kunne spille for en storklub.
End of explanation
"""
... |
Krekelmans/Train_prediction_kaggle | backup.ipynb | mit | %matplotlib inline
%pylab inline
import pandas as pd
import numpy as np
from collections import Counter, OrderedDict
import json
import matplotlib
import matplotlib.pyplot as plt
import re
from scipy.misc import imread
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import StratifiedKFo... |
phoebe-project/phoebe2-docs | 2.0/tutorials/meshes.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.0,<2.1"
"""
Explanation: Accessing and Plotting Meshes
Setup
Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
"""
%matplotli... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: SANDBOX-2
Topic: Atmoschem
Sub... |
espressomd/espresso | doc/tutorials/active_matter/active_matter.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
import tqdm
import numpy as np
import espressomd.observables
import espressomd.accumulators
espressomd.assert_features(
["ENGINE", "ROTATION", "MASS", "ROTATIONAL_INERTIA", "CUDA"])
ED_PARAMS = {'time_step': 0.01,
... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/image_classification/solutions/1_mnist_linear.ipynb | apache-2.0 | import os
import shutil
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.callbacks import ModelCheckpoint, TensorBoard
from tensorflow.keras.layers import Dense, Flatten, Softmax
print(tf.__version__)
!python3 -m pip freeze | gre... |
pyreaclib/pyreaclib | pynucastro/library/tabular/generate_tabulated_file.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import re
import matplotlib.pyplot as plt
f = open("/Users/sailor/Desktop/A23_Ne_F.dat","r")
data = f.readlines() # data is a list. each element is a line of "A23_Ne_F.dat"
f.close()
"""
Explanation: How to generate data files for tabulated rates
These tabulated reaction rates ... |
tensorflow/docs-l10n | site/ja/probability/examples/Linear_Mixed_Effects_Model_Variational_Inference.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
kubeflow/pipelines | components/gcp/dataproc/delete_cluster/sample.ipynb | apache-2.0 | %%capture --no-stderr
!pip3 install kfp --upgrade
"""
Explanation: Name
Data preparation by deleting a cluster in Cloud Dataproc
Label
Cloud Dataproc, cluster, GCP, Cloud Storage, Kubeflow, Pipeline
Summary
A Kubeflow Pipeline component to delete a cluster in Cloud Dataproc.
Intended use
Use this component at the sta... |
sz2472/foundations-homework | Homework_4_database_shengyingzhao_graded.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: Grade: 11 / 11 -- look for TA-COMMENT
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... |
mne-tools/mne-tools.github.io | 0.17/_downloads/10d15867c4c4d54609e083ad834f1606/plot_dipole_fit.ipynb | bsd-3-clause | from os import path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.forward import make_forward_dipole
from mne.evoked import combine_evoked
from mne.simulation import simulate_evoked
from nilearn.plotting import plot_anat
from nilearn.datasets import load_mni152_template
data_path = mne... |
dereneaton/ipyrad | newdocs/API-analysis/cookbook-treeslider-reference.ipynb | gpl-3.0 | # conda install ipyrad -c bioconda
# conda install raxml -c bioconda
# conda install toytree -c eaton-lab
import ipyrad.analysis as ipa
import toytree
"""
Explanation: <span style="color:gray">ipyrad-analysis toolkit:</span> treeslider
<h5><span style="color:red">(Reference only method)</span></h5>
With reference ma... |
jarvis-fga/Projetos | Problema 2/Daniel - Julliana/.ipynb_checkpoints/Amazon2-checkpoint.ipynb | mit | import codecs
with codecs.open("imdb_labelled.txt", "r", "utf-8") as arquivo:
vetor = []
for linha in arquivo:
vetor.append(linha)
with codecs.open("amazon_cells_labelled.txt", "r", "utf-8") as arquivo:
for linha in arquivo:
vetor.append(linha)
with codecs.open("yelp_labelled.txt", "r", "... |
poppy-project/community-notebooks | tutorials-education/poppy-torso__vrep_Prototype d'ininitiation à l'informatique pour les lycéens/Jeux/jeté de balle.ipynb | lgpl-3.0 | import time
from poppy.creatures import PoppyTorso
poppy = PoppyTorso(simulator='vrep')
"""
Explanation: Jeté de balle – Niveau 1 - Python
TP1
Pour commencer votre programme python devra contenir les lignes de code ci-dessous et le logiciel V-REP devra être lancé.
Dans V-REP (en haut à gauche) utilise les deux icones... |
strandbygaard/deep-learning | reinforcement/Q-learning-cart.ipynb | mit | import gym
import tensorflow as tf
import numpy as np
"""
Explanation: Deep Q-learning
In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-1/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', 'test-institute-1', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: TEST-INSTITUTE-1
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepp... |
facebook/prophet | notebooks/seasonality,_holiday_effects,_and_regressors.ipynb | mit | %%R
library(dplyr)
playoffs <- data_frame(
holiday = 'playoff',
ds = as.Date(c('2008-01-13', '2009-01-03', '2010-01-16',
'2010-01-24', '2010-02-07', '2011-01-08',
'2013-01-12', '2014-01-12', '2014-01-19',
'2014-02-02', '2015-01-11', '2016-01-17',
'... |
ethanrowe/flowz | userguide/05. Incremental Assembly.ipynb | mit | random.seed(1)
chan = IterChannel((i, random.randint(100, 200)) for i in range(10))
print_chans(chan.tee())
"""
Explanation: Incremental Assembly
Suppose you have a function that calculates some value for a given index, which we will think of as "days from the beginning of the year".
End of explanation
"""
from flow... |
regardscitoyens/consultation_an | exploitation/analyse_quanti_theme3.ipynb | agpl-3.0 | def loadContributions(file, withsexe=False):
contributions = pd.read_json(path_or_buf=file, orient="columns")
rows = [];
rindex = [];
for i in range(0, contributions.shape[0]):
row = {};
row['id'] = contributions['id'][i]
rindex.append(contributions['id'][i])
if (withsexe... |
pysal/spaghetti | notebooks/network-spatial-dependence.ipynb | bsd-3-clause | %config InlineBackend.figure_format = "retina"
%load_ext watermark
%watermark
import geopandas
import libpysal
import matplotlib
import matplotlib_scalebar
from matplotlib_scalebar.scalebar import ScaleBar
import numpy
import spaghetti
%matplotlib inline
%watermark -w
%watermark -iv
"""
Explanation: If any part of ... |
NYUDataBootcamp/Projects | UG_F16/Mario Zapata_AirBnb Multiple Listings in Barcelona.ipynb | mit | import pandas as pd
import sys # system module
import pandas as pd # data package
import matplotlib as mpl # graphics package
import matplotlib.pyplot as plt # pyplot module
import datetime as dt # date and time module
import numpy a... |
CalPolyPat/phys202-2015-work | assignments/assignment06/ProjectEuler17.ipynb | mit | import numpy as np
def number_to_words(n,numlist):
"""Given a number n between 1-1000 inclusive return a list of words for the number."""
if len(str(n)) == 1:
if str(n)[-1] == '1':
numlist.append('one')
elif str(n)[-1] == '2':
numlist.append('two')
... |
RogueAstro/solar-twins-project | find_vsini.ipynb | gpl-2.0 | import numpy as np
from pwoogs import moog,estimate,utils
import matplotlib.pyplot as plt
import q2
import shutil as sh
%matplotlib inline
# Getting star names
star_names = np.loadtxt('s_twins.csv',
skiprows=1,
usecols=(0,),
dtype=str,
... |
IanHawke/maths-with-python | 11-more-classes.ipynb | mit | class Polynomial(object):
"""Representing a polynomial."""
explanation = "I am a polynomial"
def __init__(self, roots, leading_term):
self.roots = roots
self.leading_term = leading_term
self.order = len(roots)
def display(self):
string = str(self.leading_ter... |
fnakashima/deep-learning | student-admissions-keras/StudentAdmissionsKeras.ipynb | mit | # Importing pandas and numpy
import pandas as pd
import numpy as np
# Reading the csv file into a pandas DataFrame
data = pd.read_csv('student_data.csv')
# Printing out the first 10 rows of our data
data[:10]
"""
Explanation: Predicting Student Admissions with Neural Networks in Keras
In this notebook, we predict st... |
gte620v/graph_entity_resolution | 201610_EmoryDS/Talk.ipynb | apache-2.0 | df = pd.read_csv(
'../data/scraped_data.csv.gz',
converters={'name': lambda x: str(x).lower(),
'number': str,
'oid': str,
'post_id': str},
parse_dates=['postdate'])
df.head()
"""
Explanation: <div><img src="../images/title.png"></div>
501c3 Nonprofit started... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.