repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
nipunsadvilkar/ProbabilityForHackers | Introduction to Probability.ipynb | mit | from IPython.display import HTML
HTML('<iframe src="https://nipunsadvilkar.github.io/coin-flip/" width="100%" height="700px" scrolling="no" style="margin-top: -70px;" frameborder="0"></iframe>')
"""
Explanation: Probability is
How likely something is to happen.
Let's start with obligatory example of coin-toss<br>
H... |
slac207/cs207project | TimeseriesDB/play4.ipynb | mit | import MessageFormatting
import importlib
importlib.reload(MessageFormatting)
from MessageFormatting import *
from timeseries.ArrayTimeSeries import ArrayTimeSeries as ts
import numpy as np
from scipy.stats import norm
t = np.arange(0.0, 1.0, 0.01)
v = norm.pdf(t, 100, 100) + 1000*np.random.randn(100)
ts_test = ts(t,... |
Esri/gis-stat-analysis-py-tutor | notebooks/PySAL - ArcGIS Integration Framework.ipynb | apache-2.0 | import arcpy as ARCPY
import arcgisscripting as ARC
import SSDataObject as SSDO
import SSUtilities as UTILS
import WeightsUtilities as WU
import numpy as NUM
import scipy as SCIPY
import pysal as PYSAL
import os as OS
import pandas as PANDAS
"""
Explanation: Installation
Follow directions at the PySAL-ArcGIS-Toolbox ... |
google/eng-edu | ml/cc/prework/zh-CN/tensorflow_programming_concepts.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
Iwan-Zotow/VV | C15_GP3.ipynb | mit | import math
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import BEAMphsf
import text_loader
import H1Dn
import H1Du
import ListTable
%matplotlib inline
"""
Explanation: Validation and Verification of the 15mm collimator simulation, GP3
Here we provide code and output which verifies and valid... |
DigitalSlideArchive/HistomicsTK | docs/examples/polygon_merger_using_rtree.ipynb | apache-2.0 | import os
import sys
CWD = os.getcwd()
sys.path.append(os.path.join(CWD, '..', '..', 'histomicstk', 'annotations_and_masks'))
import girder_client
from histomicstk.annotations_and_masks.polygon_merger_v2 import Polygon_merger_v2
from histomicstk.annotations_and_masks.masks_to_annotations_handler import (
get_annota... |
secimTools/SECIMTools | notebook/pca_testing.ipynb | mit | import pandas as pd
import numpy as np
from sklearn.decomposition import PCA
"""
Explanation: PCA Python vs R
Originally, R was used to calculate PCA using both princomp and prcomp. However, rpy2 stopped was intorducing some issues on the galaxy server. I decided to switch the calculation over to a pure python solutio... |
agile-geoscience/striplog | docs/tutorial/15_Model_sequences_with_Markov_chains.ipynb | apache-2.0 | import striplog
striplog.__version__
"""
Explanation: Model sequences with Markov chains
Launch this notebook:
https://colab.research.google.com/github/agile-geoscience/striplog/blob/develop/tutorial/Markov_chains.ipynb
You need striplog version 0.8.6 or later for this notebook to work as intended.
End of explanatio... |
smorton2/think-stats | code/chap09exmine.ipynb | gpl-3.0 | from __future__ import print_function, division
%matplotlib inline
import numpy as np
import random
import thinkstats2
import thinkplot
"""
Explanation: Examples and Exercises from Think Stats, 2nd Edition
http://thinkstats2.com
Copyright 2016 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
End of... |
otavio-r-filho/AIND-Deep_Learning_Notebooks | 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... |
tensorflow/docs-l10n | site/ko/lite/performance/post_training_integer_quant_16x8.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... |
TimothyHelton/k2datascience | notebooks/Linear_Regression_Simple.ipynb | bsd-3-clause | from k2datascience import linear_regression
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
%matplotlib inline
"""
Explanation: Linear Regression
Timothy Helton
The goal of this assignment is to build a simple linear regression algorithm from scratch. Linear... |
rice-solar-physics/hot_plasma_single_nanoflares | notebooks/compute_ionpopsolver_results.ipynb | bsd-2-clause | import os
import pickle
import multiprocessing
import subprocess
import xml.etree.ElementTree as ET
import numpy as np
"""
Explanation: Compute IonPopSolver Results
Here, we'll run the IonPopSolver code using some of the EBTEL results in order to account for non-equilibrium ionization in our results. We'll use the mu... |
mercye/foundations-homework | 08/Homework_8_Emelike.ipynb | mit | import pandas as pd
import numpy as np
import random
import matplotlib.pyplot as plt
plt.style.use('ggplot')
%matplotlib inline
"""
Explanation: Using two datasets you find from the internet, do the following for each
End of explanation
"""
df = pd.read_csv('Mother Jones US Mass Shootings 1982-2016 - US mass shoot... |
castelao/CoTeDe | docs/notebooks/NOAA-sea_level.ipynb | bsd-3-clause | import numpy as np
from bokeh.io import output_notebook, show
from bokeh.layouts import column, row
from bokeh.models import ColumnDataSource, CustomJS, Slider
from bokeh.plotting import figure
import pandas as pd
from scipy import stats
import cotede
from cotede import datasets, qctests
print("CoTeDe version: {}".fo... |
evanmiltenburg/python-for-text-analysis | Chapters/Chapter 05 - Core concepts of containers.ipynb | apache-2.0 | # Some examples (you do not have to remember this now):
a_list = [1,2,3, "let's", "use", "containers"]
a_tuple = (1, 2, 3, "let's", "use", "containers")
a_set = {1, 2, 3, "let's", "use", "containers"}
a_dict = {1:"let's", 2:"use", 3: "containers"}
#print(a_list)
#print(a_tuple)
#print(a_set)
#print(a_dict)
"""
Expl... |
DanielAndreasen/Programmers-Club | previous_versions/notebook/Regression - CAUP Programming Club.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from astroML.datasets import fetch_sdss_sspp
from astroML.plotting import hist
import seaborn as sns
import pandas as pd
import sys
import cPickle
from sklearn.linear_model import Ridge, Lasso
%matplotlib inline
"""
Explanation: Regression exploration
There are variou... |
mne-tools/mne-tools.github.io | stable/_downloads/d5a59f5536154816047f788dc4573ab4/60_sleep.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets.sleep_physionet.age import fetch_data
from mne.time_fr... |
tjctw/PythonNote | cs61a/Chapter 1 note.ipynb | cc0-1.0 | #example:
def split(n):
return n//10, n%10
def sum_digits(n):
#base case (without recursive call)
if n<10:
return n
#recursive calls
else:
all_but_last, last = split(n)
return sum_digits(all_but_last) + last
def luhn_sum_double(n):
all_but_last, last =split(n)
luhn_... |
mne-tools/mne-tools.github.io | stable/_downloads/6606225adee10a4b2296b56fd8513f72/10_array_objs.ipynb | bsd-3-clause | import mne
import numpy as np
"""
Explanation: Creating MNE-Python data structures from scratch
This tutorial shows how to create MNE-Python's core data structures using an
existing :class:NumPy array <numpy.ndarray> of (real or synthetic) data.
We begin by importing the necessary Python modules:
End of explanat... |
Kaggle/learntools | notebooks/embeddings/raw/3-exercises.ipynb | apache-2.0 | import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import tensorflow as tf
from tensorflow import keras
from gensim.models.keyedvectors import WordEmbeddingsKeyedVectors
from learntools.core import binder; binder.bind(globals())
from learntools.embeddings.ex3_gensim import *
#_RM_
... |
solowPy/binder | notebooks/5 Impulse response functions.ipynb | mit | # use tab completion to see the available attributes and methods...
solowpy.impulse_response.ImpulseResponse.
"""
Explanation: 5. Impulse response functions
Impulse response functions (IRFs) are a standard tool for analyzing the short run dynamics of dynamic macroeconomic models, such as the Solow growth model, in res... |
evanmiltenburg/python-for-text-analysis | Chapters-colab/Chapter_18_Data_formats_III_(XML).ipynb | apache-2.0 | %%capture
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Data.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/images.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Extra_Material.zip
!unzip Data.zip -d ../
!unzip images.zip -d ./
!unzip Ext... |
mbeyeler/opencv-machine-learning | notebooks/11.03-Tuning-Hyperparameters-with-Grid-Search.ipynb | mit | from sklearn.datasets import load_iris
import numpy as np
iris = load_iris()
X = iris.data.astype(np.float32)
y = iris.target
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(
X, y, random_state=37
)
"""
Explanation: <!--BOOK_INFORMATION-->
<a href="https://... |
hailing-li/hailing-li.github.io | HW2/Linear Regression.ipynb | mit | import sqlite3
import pandas as pd
from pprint import pprint
from pandas import DataFrame
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
import math
import numpy as np
conn = sqlite3.connect('bicycle.db')
c=conn.cursor()
c.execute('SELECT HiTemp, LoT... |
n-witt/MachineLearningWithText_SS2017 | tutorials/0 Python basics 2.ipynb | gpl-3.0 | True and True
True or False
bool(1)
bool(0)
"""
Explanation: Booleans
End of explanation
"""
a = None
a is None
b = 'is something'
b is not None
"""
Explanation: None
None is Python's null value.
End of explanation
"""
a = 4
if a > 0:
print('more than 0')
if a <= 0:
print('0 or less')
elif a > 0 and ... |
gojira/tensorflow | tensorflow/contrib/eager/python/examples/notebooks/4_high_level.ipynb | apache-2.0 | # In the tf.keras.layers package, layers are objects. To construct a layer,
# simply construct the object. Most layers take as a first argument the number
# of output dimensions / channels.
layer = tf.keras.layers.Dense(100)
# The number of input dimensions is often unnecessary, as it can be inferred
# the first time t... |
yhat/ggplot | docs/how-to/Intro to ggplot.ipynb | bsd-2-clause | %matplotlib inline
from ggplot import *
diamonds.head()
"""
Explanation: Basic Premise
Making plots is a very repetitive: draw this line, add these colored points, then add these, etc. Instead of re-using the same code over and over, ggplot implements them using a high-level but very expressive API. The result is less... |
mohsinhaider/pythonbootcampacm | Objects and Data Structures/Lists.ipynb | mit | # Creating a list with the numbers 1 to 5
my_list = [1, 2, 3, 4, 5]
"""
Explanation: Lists
A list is an indexable and mutable sequence of objects. In short, lists are capable of holding various types of objects. Understand that this is a data structure, as it holds data for us.
In this lecture we will cover:
1. Initia... |
networks-lab/mkD3 | Resources/.ipynb_checkpoints/INTEG 120-checkpoint.ipynb | gpl-3.0 | # Only run this the VERY first time
!pip install metaknowledge
!pip install networkx
!pip install pandas
!pip install python-louvain
# Run this before you do anything else
import metaknowledge as mk
import networkx as nx
import pandas
import community
import webbrowser
# The line below is the most important line in t... |
ITAM-DS/analisis-numerico-computo-cientifico | libro_optimizacion/temas/1.computo_cientifico/1.4/Condicion_de_un_problema_y_estabilidad_de_un_algoritmo.ipynb | apache-2.0 | import math
x=1
print(math.exp(x))
"""
Explanation: (CPEA)=
1.4 Condición de un problema y estabilidad de un algoritmo
```{admonition} Notas para contenedor de docker:
Comando de docker para ejecución de la nota de forma local:
nota: cambiar <ruta a mi directorio> por la ruta de directorio que se desea mapear a ... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/custom/showcase_custom_tabular_regression_online_explain.ipynb | apache-2.0 | import os
import sys
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install -U google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex client library: Custom training tabular regression model for online prediction with ... |
testedminds/lein-topology | docs/High-Level Architecture.ipynb | apache-2.0 | from py2cytoscape.data.cynetwork import CyNetwork
from py2cytoscape.data.cyrest_client import CyRestClient
from py2cytoscape.data.style import StyleUtil
import sand
import matplotlib.pyplot as plt
%matplotlib notebook
"""
Explanation: Analyzing the lein-topology function dependency network
Automating recommendation... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/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', 'csiro-bom', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Propertie... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/tfx_pipelines/pipeline/solutions/tfx_pipeline.ipynb | apache-2.0 | import yaml
# Set `PATH` to include the directory containing TFX CLI and skaffold.
PATH = %env PATH
%env PATH=/home/jupyter/.local/bin:{PATH}
"""
Explanation: Continuous training with TFX and Google Cloud AI Platform
Learning Objectives
Use the TFX CLI to build a TFX pipeline.
Deploy a TFX pipeline version without t... |
BenLangmead/comp-genomics-class | notebooks/RepeatMasker.ipynb | gpl-2.0 | import urllib.request
rm_site = 'http://www.repeatmasker.org'
fn = 'ce10.fa.out.gz'
url = '%s/genomes/ce10/RepeatMasker-rm405-db20140131/%s' % (rm_site, fn)
urllib.request.urlretrieve(url, fn)
import gzip
import itertools
fh = gzip.open(fn, 'rt')
for ln in itertools.islice(fh, 10):
print(ln, end='')
"""
Explanati... |
google-research/sofima | notebooks/em_stitching.ipynb | apache-2.0 | !pip install git+https://github.com/google-research/sofima
import functools as ft
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
import PIL
"""
Explanation: Stitching tiled electron microscopy data
This notebook demonstrates how to use SOFIMA to build seamless section images out... |
tensorflow/recommenders | docs/examples/efficient_serving.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... |
xiongzhenggang/xiongzhenggang.github.io | data-science/25-简单散点图.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
# 使用风格seaborn白底
plt.style.use('seaborn-whitegrid')
import numpy as np
"""
Explanation: 简单散点图
另一种常用的图类型是简单散点图,线图的近亲。此处的点不是由线段连接,而是由点,圆或其他形状分别表示。首先,设置ipython notebook得作图环境:
End of explanation
"""
x = np.linspace(0, 10, 30)
y = np.sin(x)
plt.plot(x, y, 'o', color='blac... |
dxwils3/machine_learning | neural_networks/TensorFlowMNIST.ipynb | mit | import tensorflow.examples.tutorials.mnist.input_data as id
mnist = id.read_data_sets('MNIST_data', one_hot=True)
import tensorflow as tf
sess = tf.InteractiveSession()
"""
Explanation: This code is taken from the TensorFlow tutorial expert example. The purpose here is to create an MNIST classifier. I tried to remo... |
eleijonmarck/dicommunify | notebooks/image_classification.ipynb | mit | import os
curr_dir = %pwd
proj_dir = os.path.normpath(os.path.join(curr_dir, os.path.pardir))
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
from keras import regularizers
from keras.layers.normalization import BatchNormali... |
feststelltaste/software-analytics | notebooks/Storing Git commit information into Pandas' DataFrame.ipynb | gpl-3.0 | import pandas as pd
import git
"""
Explanation: Software version control systems contain a huge amount of evolutionary data. It's very common to mine these repositories to gain some insight about how the development of a software product works. But there is the need for some preprocessing of that data to avoid false a... |
akohlmey/lammps | python/examples/pylammps/interface_usage.ipynb | gpl-2.0 | from lammps import IPyLammps
L = IPyLammps()
# 3d Lennard-Jones melt
L.units("lj")
L.atom_style("atomic")
L.atom_modify("map array")
L.lattice("fcc", 0.8442)
L.region("box block", 0, 4, 0, 4, 0, 4)
L.create_box(1, "box")
L.create_atoms(1, "box")
L.mass(1, 1.0)
L.velocity("all create", 1.44, 87287, "loop geom")
L.p... |
bloomberg/bqplot | examples/Marks/Object Model/Lines.ipynb | apache-2.0 | import numpy as np # For numerical programming and multi-dimensional arrays
from pandas import date_range # For date-rate generation
from bqplot import LinearScale, Lines, Axis, Figure, DateScale, ColorScale
"""
Explanation: The Lines Mark
Lines is a Mark object that is primarily used to visualize quantitative data.... |
udacity/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... |
napsternxg/DataMiningPython | Lecture Notebooks/Getting Started.ipynb | gpl-3.0 | a = 10
b = 20
c = "Hello"
print a, b, c
"""
Explanation: Getting started
Python basiscs
Loading data
Plotting data
Python basics
For a data scientist learning some basic data structures available in python is very important for efficient usage of the tools available in the python ecosystem.
Variables
Variables can... |
tiagoantao/biopython-notebook | notebooks/15 - Cluster Analysis.ipynb | mit | from Bio.Cluster import distancematrix
matrix = distancematrix(data)
"""
Explanation: Source of the materials: Biopython cookbook (adapted)
<font color='red'>Status: Draft</font>
Cluster analysis
Cluster analysis is the grouping of items into clusters based on the
similarity of the items to each other. In bioinformati... |
bmeaut/python_nlp_2017_fall | course_material/07_Tagging/07_Scipy_lab.ipynb | mit | import numpy, scipy
%matplotlib inline
import matplotlib.pyplot
"""
Explanation: Python for mathematics, science and engineering
https://scipy.org/
Scipy
(pronounced "Sigh Pie")
Higher level algorithms on top of numpy
numerical integration
optimization
interpolation
Signal Processing
Linear Algebra
with sparse matric... |
hanhanwu/Hanhan_Data_Science_Practice | Applied_Statistics/Learning_Notes/ANOVA_practice.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import seaborn as sns
sns.set(color_codes=True)
from statsmodels.formula.api import ols
from statsmodels.stats.anova import anova_lm
from statsmodels.stats.multicomp import MultiComparison
from sklearn.pr... |
TheOregonian/long-term-care-db | notebooks/analysis/.ipynb_checkpoints/complaints_analysis-checkpoint.ipynb | mit | import pandas as pd
import numpy as np
import analysis_data_loader as loader
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
pd.set_option('display.max_colwidth', -1)
df = loader.load_facilities()
df = pd.read_csv('/Users/fzarkhin/OneDrive - Advance... |
jhseu/tensorflow | tensorflow/lite/micro/examples/hello_world/create_sine_model.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... |
Phylliade/poppy-inverse-kinematics | tutorials/Moving the Poppy Torso using Inverse Kinematics.ipynb | gpl-2.0 | from poppy.creatures import PoppyTorso
poppy = PoppyTorso(simulator="vrep")
"""
Explanation: Moving the Poppy Torso using Inverse Kinematics
This notebook illustrates how you can use the kinematic chains defined by the PoppyTorso class to directly control the arms of the robot in the cartesian space.
Said in a simpl... |
mne-tools/mne-tools.github.io | 0.20/_downloads/ecc882c301a68ccc90d86f64acb4e0a7/plot_stats_cluster_spatio_temporal_2samp.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import os.path as op
import numpy as np
from scipy import stats as stats
import mne
from mne import spatial_src_connectivity
from mne.stats import spatio_temporal_cluster_test, summa... |
enram/data-repository | file_transfer/tutorial_datamover.ipynb | mit | import datamover as dm
"""
Explanation: Python datamover module tutorial
Introduction
The datamover Python module provides high-level functionalities to transfer files in between different file resources (local, GitHub, S3 buckets and FTP-drives). To activate the functionalities, import the library functions:
End of e... |
abelfunctions/abelfunctions | notebooks/Riemann Constant Vector Paper.ipynb | mit | from sympy.abc import x,y
from abelfunctions import (RiemannSurface, RiemannTheta, Jacobian,
AbelMap, RiemannConstantVector, puiseux)
f = x**2*y**3 - x**4 + 1
X = RiemannSurface(f,x,y)
g = X.genus()
omega = X.holomorphic_differentials()
print 'differentials:'
for omegai in omega:
print ... |
Lordmzn/pydmmt | examples/Running and analysing test_lake.ipynb | mit | from subprocess import Popen, PIPE, STDOUT
p = Popen(["../pydmmt/pydmmt.py", "test_lake.yml"], stdin=PIPE, stdout=PIPE, stderr=STDOUT)
output = p.communicate(".3".encode('utf-8'))[0]
# trim the '\n' newline char
print(output[:-1].decode('utf-8'))
"""
Explanation: Running a model and loading the simulation it produces
... |
tylerwmarrs/billboard-hot-100-lyric-analysis | notebooks/exploratory/02-raw-lyric-analysis.ipynb | mit | import string
import os
import requests
from fake_useragent import UserAgent
from lxml import html
def requests_get(url):
ua = UserAgent().random
return requests.get(url, headers={'User-Agent': ua})
def get_swear_words(save_file='swear-words.txt'):
"""
Scrapes a comprehensive list of swear ... |
dxl0632/deeplearning_nd_udacity | sentiment-rnn/Sentiment_RNN_Solution.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment-network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment-network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
nilbody/h2o-3 | h2o-py/demos/H2O_DEPRECATED_tutorial_medium.ipynb | apache-2.0 | import pandas as pd
import numpy
from numpy.random import choice
from sklearn.datasets import load_boston
import h2o
h2o.init()
# transfer the boston data from pandas to H2O
boston_data = load_boston()
X = pd.DataFrame(data=boston_data.data, columns=boston_data.feature_names)
X["Median_value"] = boston_data.target
X ... |
mF2C/COMPSs | tests/sources/python/9_jupyter_notebook/src/simpleGAT.ipynb | apache-2.0 | import pycompss.interactive as ipycompss
"""
Explanation: Test suite for Jupyter-notebook
Sample example of use of PyCOMPSs from Jupyter
First step
Import ipycompss library
End of explanation
"""
ipycompss.start(graph=True, trace=True, debug=True, project_xml='../project.xml', resources_xml='../resources.xml', comm=... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-lm/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lm', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-LM
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radi... |
bobmyhill/burnman | contrib/ipython/Create_1D_ASPECT_profile.ipynb | gpl-2.0 | interactive = True
if interactive:
%matplotlib ipympl
import ipywidgets as widgets
import mpl_interactions.ipyplot as iplt
"""
Explanation: Create relaxed geodynamic 1D profile
NOTE: This notebook contains an interactive figure with sliders. it relies on python modules ipympl and mpl_interactions.
If you w... |
rashikaranpuria/Machine-Learning-Specialization | Machine Learning Foundations: A Case Study Approach/Assignment_five/.ipynb_checkpoints/Deep Features for Image Retrieval-checkpoint.ipynb | mit | import graphlab
graphlab.product_key.set_product_key("7348-CE53-3B3E-DBED-152B-828E-A99E-F303")
"""
Explanation: Building an image retrieval system with deep features
Fire up GraphLab Create
End of explanation
"""
image_train = graphlab.SFrame('image_train_data/')
image_test = graphlab.SFrame('image_test_data/')
""... |
locationtech/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... |
eds-uga/csci1360-fa16 | assignments/A1/A1_Q4.ipynb | mit | def cumulative_product(start_list):
out_list = []
### BEGIN SOLUTION
### END SOLUTION
return out_list
inlist = [89, 22, 3, 24, 8, 59, 43, 97, 30, 88]
outlist = [89, 1958, 5874, 140976, 1127808, 66540672, 2861248896, 277541142912, 8326234287360, 732708617287680]
assert set(cumulative_pr... |
giacomov/3ML | docs/notebooks/Analysis_results_showcase.ipynb | bsd-3-clause | from threeML import *
from threeML.analysis_results import *
from threeML.io.progress_bar import progress_bar
from jupyterthemes import jtplot
%matplotlib inline
jtplot.style(context="talk", fscale=1, ticks=True, grid=False)
import matplotlib.pyplot as plt
plt.style.use("mike")
import astropy.units as u
"""
E... |
InsightLab/data-science-cookbook | 2019/09-clustering/cl_Helio.ipynb | mit | # import libraries
# linear algebra
import numpy as np
# data processing
import pandas as pd
# data visualization
from matplotlib import pyplot as plt
# load the data with pandas
dataset = pd.read_csv('dataset.csv', header=None)
dataset = np.array(dataset)
plt.scatter(dataset[:,0], dataset[:,1], s=10)
plt.show()
... |
AllenDowney/ModSimPy | notebooks/chap18.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
balarsen/pymc_learning | Propagation_of_uncertainty/Examples-pymc3.ipynb | bsd-3-clause | import numpy as np
import pymc3 as pm
import seaborn as sns
import arviz as ar
sns.set(font_scale=1.5)
%matplotlib inline
"""
Explanation: Examles of error propigation
Examples are taken from http://ipl.physics.harvard.edu/wp-uploads/2013/03/PS3_Error_Propagation_sp13.pdf and used on MCMC to show how the answers work... |
chseifert/tutorials | data-science/Data-Preprocessing.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import pylab as plt
# Set the global default size of matplotlib figures
plt.rc('figure', figsize=(10, 5))
# Size of matplotlib figures that contain subplots
fizsize_with_subplots = (10, 10)
# Size of matplotlib histogram bins
bin_size = 10
"""
Explanation: Predicting Titanic ... |
4dsolutions/Python5 | CuboidalE3.ipynb | mit | from math import sqrt as rt2
ø = (rt2(5) + 1)/2
ø_down = ø ** -1
ø_up = ø
Blue = ø_down
Orange = 1/((rt2(ø ** 2 + 1)) * ø_down)
Red = rt2(ø ** 2 + 1)
for item in Blue, Orange, Red:
print(item)
"""
Explanation: Cuboidal E3: A Study in Structure
(version 1.4)
<br />
<br />
<div style="text-align: center">
<a data-f... |
espressomd/espresso | doc/tutorials/charged_system/charged_system.ipynb | gpl-3.0 | import espressomd
import espressomd.electrostatics
import espressomd.observables
import espressomd.accumulators
import espressomd.math
espressomd.assert_features(['ELECTROSTATICS', 'P3M', 'WCA'])
import tqdm
import numpy as np
import scipy.optimize
%matplotlib inline
import matplotlib.pyplot as plt
np.random.seed(41... |
wmorning/EvilLens | examples/AntennaEffects.ipynb | gpl-2.0 | %matplotlib inline
import evillens as evil
import numpy as np
import matplotlib.pyplot as plt
from scipy import fftpack
from operator import mul
"""
Explanation: Antenna Effects Demonstration
End of explanation
"""
saboteur = evil.Saboteur(150.0,0.001)
saboteur.read_data_from('/Users/wmorning/research/data/HugoDrax_... |
eds-uga/csci1360e-su17 | assignments/A10/A10_Q1.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import sklearn.datasets as datasets
import seaborn as sns
iris = datasets.load_iris()
"""
Explanation: Q1
In this question, you'll design a very simple classifier to work on a real-world dataset.
The iris dataset is a general-purpose dataset for cl... |
asncd/schimera | Theseus_dropseq_example.ipynb | mit | df_umi=pd.DataFrame([list(x) for x in T_tot['Molecular_Barcode']])
bp_umi=[bp_calc(''.join(np.array(df_umi[x]))) for x in range(np.shape(df_umi)[1])]
#use per base relative entropy to calculate the effective diversity of the umi library based on basepair composition bias
def s_entropy(p):
y=[x*np.log2(x) for x in ... |
biof-309-python/BIOF309-2016-Fall | Week_05/Week05 - 02 - Functions.ipynb | mit | 6 * 6
"""
Explanation: Functions
Definition:
Function: (1) In programming, a named section of a program that performs a specific task. In this sense, a function is a type of procedure or routine. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs s... |
aje/POT | notebooks/plot_otda_mapping.ipynb | mit | # Authors: Remi Flamary <remi.flamary@unice.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
#
# License: MIT License
import numpy as np
import matplotlib.pylab as pl
import ot
"""
Explanation: OT mapping estimation for domain adaptation
This example presents how to use MappingTransport to estimate at the sa... |
google-research/big_transfer | colabs/big_transfer_jax.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# 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 ap... |
navaro1/deep-learning | intro-to-tflearn/TFLearn_Digit_Recognition.ipynb | mit | # Import Numpy, TensorFlow, TFLearn, and MNIST data
import numpy as np
import tensorflow as tf
import tflearn
import tflearn.datasets.mnist as mnist
"""
Explanation: Handwritten Number Recognition with TFLearn and MNIST
In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9.
This... |
machinelearningnanodegree/stanford-cs231 | solutions/levin/assignment1/knn.ipynb | mit | # 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.... |
mikekestemont/vedas | Vedas.ipynb | mit | hymns = {}
for line in open('dimeter-mp.csv', 'r'):
comps = line.strip().split(',')
line, pada, meter = comps[0:3]
mps = comps[3:]
hymn_id = '-'.join(line.split('.')[:2])
if hymn_id not in hymns:
hymns[hymn_id] = []
hymns[hymn_id].append(mps)
"""
Explanation: Structure of the lines is:
... |
quasars100/Resonance_testing_scripts | python_tutorials/Testparticles.ipynb | gpl-3.0 | import rebound
rebound.reset()
rebound.add(m=1.)
rebound.add(m=1e-3, a=1, e=0.05)
rebound.move_to_com()
rebound.integrator = "whfast-nocor"
rebound.dt = 0.05
"""
Explanation: Test particles
In this tutorial, we run a simulation with many test particles. Test particles have no mass and do therefore not perturb other pa... |
anilcs13m/MachineLearning_Mastering | Overfitting_Ridge_Lasso.ipynb | gpl-2.0 | import graphlab
import math
import random
import numpy
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Overfitting
Create a dataset based on a true sinusoidal relationship
Let's look at a synthetic dataset consisting of 30 points drawn from the sinusoid $y = \sin(4x)$:
End of explanation
"""
... |
phanrahan/magmathon | notebooks/advanced/verilator.ipynb | mit | def f(a, b, c):
return (a & b) ^ c
"""
Explanation: Start by defining a Python function that we want to compute.
End of explanation
"""
import magma as m
import mantle
class VerilatorExample(m.Circuit):
io = m.IO(a=m.In(m.Bit), b=m.In(m.Bit), c=m.In(m.Bit), d=m.Out(m.Bit))
io.d <= f(io.a, io.b, io.c)
m... |
saga-survey/saga-code | ipython_notebooks/Sub-masterlist.ipynb | gpl-2.0 | # This changes the current directory to the base saga directory - make sure to run this first!
# This is necessary to be able to import the py files and use the right directories,
# while keeping all the notebooks in their own directory.
import os
import sys
import tempfile
if 'saga_base_dir' not in locals():
saga... |
sdpython/ensae_teaching_cs | _doc/notebooks/exams/td_note_2022_rattrapage2.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A - Enoncé 3 mars 2022- rattrapage
Correction de l'examen du 3 mars 2022. L'objectif est de construire un arbre de façon algorithmique.
End of explanation
"""
import matplotlib.pyplot as plt
def draw(segments, L=1):
fig, ax = plt... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/labs/keras.ipynb | apache-2.0 | # Import TensorFlow and TensorFlow Datasets
import tensorflow_datasets as tfds
import tensorflow as tf
import os
# Here we'll show the currently installed version of TensorFlow
print(tf.__version__)
"""
Explanation: Distributed Training with Keras
Learning Objectives
How to define distribution strategy and set inp... |
CompPhysics/MachineLearning | doc/src/Optimization/autodiff/examples_allowed_functions.ipynb | cc0-1.0 | import autograd.numpy as np
from autograd import grad
"""
Explanation: Examples of the supported features in Autograd
Before using Autograd for more complicated calculations, it might be useful to experiment with what kind of functions Autograd is capable of finding the gradient of. The following Python functions are ... |
ibm-et/defrag2015 | notebooks/discussion.ipynb | mit | ip = get_ipython()
!rm -f /tmp/defrag_demo
!ln -s {ip.kernel.config['IPKernelApp']['connection_file']} /tmp/defrag_demo
"""
Explanation: Slackbot Functions
This notebook defines a set of functions that will be exposed by the slack_bot notebook when run. Cells executed in this notebook will be immediately available to... |
antoniomezzacapo/qiskit-tutorial | community/games/quantum_counterfeit_coin_problem.ipynb | apache-2.0 | # useful additional packages
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# useful math functions
from math import pi, cos, acos, sqrt
# importing Qiskit
from qiskit import Aer, IBMQ, execute
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
# import basic plot tools
fro... |
gchrupala/reimaginet | examples/old/ipa_img.ipynb | mit | import imaginet.task
"""
Explanation: IPA to IMAGE model
Prerequisites
In principle, this should work on a computer without a GPU. It will help if you have a lot of RAM.
Pull latest changes from https://github.com/gchrupala/reimaginet
Download http://grzegorz.chrupala.me/data/coco.zip and unzip it in the reimaginet/... |
PMEAL/OpenPNM-Examples | Simulations/mixed_continuum_and_pore_network.ipynb | mit | spacing_lg = 0.00006
layer_lg = op.network.Cubic(shape=[10, 10, 1], spacing=spacing_lg)
spacing_sm = 0.00002
layer_sm = op.network.Cubic(shape=[30, 5, 1], spacing=spacing_sm)
"""
Explanation: Generate Two Networks with Different Spacing
End of explanation
"""
# Start by assigning labels to each network for identifi... |
remenska/iSDM | notebooks/Bias_grid.ipynb | apache-2.0 | result_with_lat_long = result_with_lat_long[result_with_lat_long.decimallatitude.notnull() & result_with_lat_long.decimallongitude.notnull()]
"""
Explanation: 1. Collect and filter all observations
Recrods with latitude/longitude
End of explanation
"""
result_with_lat_long['species'].unique().size
"""
Explanation: ... |
slangeberg/udacity-datascience-nanodegree | project_0/Data_Analyst_ND_Project0.ipynb | apache-2.0 | import pandas as pd
# pandas is a software library for data manipulation and analysis
# We commonly use shorter nicknames for certain packages. Pandas is often abbreviated to pd.
# hit shift + enter to run this cell or block of code
path = r'/Users/scott/googledrive/udacity/data_science/project_0/chopstick-effectiven... |
levinsamuel/rand | python/dynamicprograms.ipynb | mit | a = {0: ('a', 'b'), 1: ('c', 'd')}
print(a[1])
df = pd.DataFrame(a)
print(df)
ssl = pd.DataFrame(-1, index=range(6), columns=range(5), dtype=int)
ssl
ssl.rank(1)
ssl.iat[3,4] = 1
ssl[:] = -1
ssl
sss = 'abcd'
print(sss[1:3])
def shortest_superseq(s1, s2):
l1, l2 = len(s1), len(s2)
seqs = pd.DataFrame(-1,
... |
cliburn/sta-663-2017 | notebook/08_SQL.ipynb | mit | import seaborn as sns
import pandas as pd
import numpy as np
from pandasql import PandaSQL
pdsql = PandaSQL()
tips = sns.load_dataset('tips')
tips.head()
"""
Explanation: SQL
SQL is a language for getting data from databases. It is also becoming essential to have some basic familiarity with SQL because it is univers... |
tensorflow/docs-l10n | site/ko/tutorials/keras/keras_tuner.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... |
maniacalbrain/apscheduler-pymongo-basics | APScheduler and PyMongo.ipynb | mit | from pymongo import MongoClient
client = MongoClient()
bitcoin = client.test_database.bitcoin
import urllib2
import requests
response = requests.get("http://api.coindesk.com/v1/bpi/currentprice.json")
bitcoin_response = response.json()
print bitcoin_response['bpi']['EUR']['rate_float']
"""
Explanation: APScheduler ... |
cetoli/draft | src/supergame/ipnb/supergame.ipynb | gpl-2.0 | import pandas as pd
df = pd.read_json("../author_data.json")
df.info()
df
"""
Explanation: ..# Activ Spyder - Captura de página do ActivUfrj
* This file is part of program Activ Spyder
* Copyright © 2022 Carlo Oliveira carlo@nce.ufrj.br,
... |
rishuatgithub/MLPy | .ipynb_checkpoints/BostonHousing-checkpoint.ipynb | apache-2.0 | import pandas as pd
import numpy as np
"""
Explanation: Boston Housing Prediction
Author: Rishu Shrivastava, Babu Sivaprakasam
Link: https://www.kaggle.com/c/boston-housing
Last Update: 02 Apr 2018
Importing libraries
End of explanation
"""
data_path = "C:/Users/Rishu/Desktop/dATA/boston/"
boston_data=pd.read_csv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.