repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
daniel-koehn/Theory-of-seismic-waves-II | 00_Intro_Python_Jupyter_notebooks/2_Jupyter_strings_and_lists.ipynb | gpl-3.0 | # Execute this cell to load the notebook's style sheet, then ignore it
from IPython.core.display import HTML
css_file = '../style/custom.css'
HTML(open(css_file, "r").read())
"""
Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2017 L.A. Barba, N.C. Clementi
... |
matsaleh13/courses | deeplearning1/nbs/lesson1-matsaleh.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Using Convolutional Neural Networks
Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning.
Introduction to this week's task: 'Do... |
mne-tools/mne-tools.github.io | 0.24/_downloads/d7719f60a0c257a5313f06f110154ff3/20_dipole_fit.ipynb | bsd-3-clause | import os.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.data... |
paulhoule/gastrodon | notebooks/local/RDFContainers.ipynb | mit | import sys
from gastrodon import *
from rdflib import *
import pandas as pd
pd.options.display.width=120
pd.options.display.max_colwidth=100
"""
Explanation: RDF Containers
In this notebook I will
Explain RDF Containers
Include test cases for gastrodon functions that support containers
Demonstrate the use of inferenc... |
BrainIntensive/OnlineBrainIntensive | resources/nipype/nipype_tutorial/notebooks/basic_data_input.ipynb | mit | from nipype import DataGrabber, Node
# Create DataGrabber node
dg = Node(DataGrabber(infields=['subject_id', 'task_id'],
outfields=['anat', 'func']),
name='datagrabber')
# Location of the dataset folder
dg.inputs.base_directory = '/data/ds102'
# Necessary default parameters
dg.inputs.... |
stanfordmlgroup/ngboost | examples/user-guide/content/1-useage.ipynb | apache-2.0 | import sys
sys.path.append('/Users/c242587/Desktop/projects/git/ngboost')
from ngboost import NGBRegressor
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
X, Y = load_boston(True)
X_train, X_test, Y_train, Y_test = train_tes... |
elenduuche/deep-learning | dcgan-svhn/DCGAN_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/sandbox-3/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-3', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: SANDBOX-3
Topic: Atmos
Sub-Topics: Dynamical Core, R... |
civisanalytics/civis-python | examples/Introducing_CivisML_v2.ipynb | bsd-3-clause | # first, let's import the packages we need
import requests
from io import StringIO
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import model_selection
# import the Civis Python API client
import civis
# ModelPipeline is the class used to build CivisML models... |
miykael/nipype_tutorial | notebooks/basic_graph_visualization.ipynb | bsd-3-clause | # Import the function to create an spm fmri preprocessing workflow
from niflow.nipype1.workflows.fmri.spm import create_spm_preproc
# Create the workflow object
spmflow = create_spm_preproc()
"""
Explanation: Graph Visualization
We've learned from the Workflow tutorial that every Nipype workflow is a directed acyclic... |
phoebe-project/phoebe2-docs | 2.1/tutorials/ORB.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: 'orb' Datasets and Options
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
"""
%matplotlib i... |
NYUDataBootcamp/Projects | MBA_S17/Huh-Ma-H1B Program.ipynb | mit | import sys
import pandas as pd
import matplotlib.pyplot as plt
import datetime as dt
import numpy as np
import requests
from bs4 import BeautifulSoup
import seaborn as sns
import ssl
%matplotlib inline
print('Python version: ', sys.version)
print('Pandas version: ', pd.__vers... |
mne-tools/mne-tools.github.io | dev/_downloads/93beebed8738eca8bfe26d41a12f4260/10_stc_class.ipynb | bsd-3-clause | import os
from mne import read_source_estimate
from mne.datasets import sample
print(__doc__)
# Paths to example data
sample_dir_raw = sample.data_path()
sample_dir = os.path.join(sample_dir_raw, 'MEG', 'sample')
subjects_dir = os.path.join(sample_dir_raw, 'subjects')
fname_stc = os.path.join(sample_dir, 'sample_au... |
sylvchev/coursIntroPython | tp/SAE03-TP1_types_operateurs.ipynb | gpl-3.0 | print("C'est parti") # affiche le texte en dessous
# essayez de modifier le texte et ré-exécuter
"""
Explanation: <img src="https://live.staticflickr.com/3089/3086874879_5eeb26eda6_w_d.jpg" align=center>
SAÉ 03 - TP1 - Tour d'horizon de Python
Bienvenue sur le Jupyter pour préparer la SAÉ Traitement numérique du sign... |
egentry/dwarf_photo-z | dwarfz/catalog_only_classifier/just plotting RF.ipynb | mit | # give access to importing dwarfz
import os, sys
dwarfz_package_dir = os.getcwd().split("dwarfz")[0]
if dwarfz_package_dir not in sys.path:
sys.path.insert(0, dwarfz_package_dir)
import dwarfz
# back to regular import statements
%matplotlib inline
from matplotlib import pyplot as plt
import matplotlib as mpl... |
GeosoftInc/gxpy | examples/jupyter_notebooks/Tutorials/2D Views and Maps.ipynb | bsd-2-clause | import geosoft.gxpy.gx as gx
import geosoft.gxpy.view as gxview
import geosoft.gxpy.group as gxgroup
import geosoft.gxpy.agg as gxagg
import geosoft.gxpy.grid as gxgrd
import geosoft.gxpy.viewer as gxviewer
import geosoft.gxpy.utility as gxu
import geosoft.gxpy.map as gxmap
from IPython.display import Image
gxc = gx.G... |
t-vi/pytorch-tvmisc | misc/gaussian_process_regression_basic.ipynb | mit | from matplotlib import pyplot
%matplotlib inline
import IPython
import torch
from torch import nn
from torch.autograd import Variable
import numpy
"""
Explanation: Gaussian Process Regression in Pytorch
Thomas Viehmann, tv@lernapparat.de
B... |
compaas/compaas | notebooks/xmltodict_demo.ipynb | mit | import json
import pprint
import functools
import xmltodict
import requests
pp = pprint.PrettyPrinter(indent=0, width=60, compact=True)
"""
Explanation: Demo for Harvesting a Zenodo Community Collection with xmltodict
End of explanation
"""
url = 'http://zenodo.org/oai2d?verb=ListRecords&metadataPrefix=oai_datacit... |
dmolina/EA_notebooks | Generating_reports_CEC2015.ipynb | gpl-3.0 | import pandas as pd
table_alg =pd.ExcelFile("results_cec2015.pdf.xlsx")
"""
Explanation: Updating final reports for CEC'2015
First, using the webpage pdftables the PDF tables are translate to Excel format.
First, we have put all results in a Excel file.
Then, we are going to use the pandas library to read the da... |
ES-DOC/esdoc-jupyterhub | notebooks/thu/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'thu', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: THU
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties: 6... |
hildensia/bayesian_changepoint_detection | Example_Code.ipynb | mit | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import seaborn
from bayesian_changepoint_detection.generate_data import generate_normal_time_series
%matplotlib inline
%load_ext autoreload
%autoreload 2
partition, data = generate_normal_time_series(7, 50, 200)
"""
Explanation: Baye... |
ClementPhil/deep-learning | language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
phoebe-project/phoebe2-docs | 2.0/tutorials/pot.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.0,<2.1"
"""
Explanation: Potentials
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
"""
%matplotlib inline
import ph... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_lcmv_beamformer_volume.ipynb | bsd-3-clause | # 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_... |
elisamussumeci/InfoDenguePredict | Notebooks/Data Exploration.ipynb | gpl-3.0 | import pandas as pd
import getpass, os
os.environ['PSQL_USER']='dengueadmin'
os.environ['PSQL_HOST']='localhost'
os.environ['PSQL_DB']='dengue'
os.environ['PSQL_PASSWORD']=getpass.getpass("Enter the database password: ")
os.chdir('..')
from infodenguepredict.data.infodengue import get_temperature_data, get_alerta_tabl... |
CGATOxford/CGATPipelines | CGATPipelines/pipeline_docs/pipeline_peakcalling/notebooks/template_peakcalling_filtering_Report.ipynb | mit | import sqlite3
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import CGATPipelines.Pipeline as P
import os
import statistics
import collections
#load R and the R packages required
# use these functions to display tables nicely as html
... |
jeffakolb/Data-Science-45min-Intros | comparing-collections/CollectionComparison_PartTwo.ipynb | unlicense | import yaml
import time
import operator
import string
import re
import csv
import random
import nltk.tokenize
from sklearn.feature_extraction import text
import twitter
import scipy
"""
Explanation: Comparing collections (Part Two)
Motivation
Review Part I
Describe what we want
Kendall's tau
Rank-biased overlap
Appl... |
ThierryMondeel/FOSBE_2016 | Code/all_analysis.ipynb | mit | import cobra
import pandas as pd
pd.set_option('display.max_colwidth', -1)
import re
import traceback
import escher
# import local functions
from show_map import show_map
# Load our modified Nagarajan et al., 2013 model
escher_file = '../Data/Escher/escher_map_c_ljungdahlii_acetogenesis_2020.json'
M = cobra.io.read... |
ES-DOC/esdoc-jupyterhub | notebooks/awi/cmip6/models/awi-cm-1-0-mr/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'awi', 'awi-cm-1-0-mr', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: AWI
Source ID: AWI-CM-1-0-MR
Sub-Topics: Radiative Forcings.
Properties: 8... |
CAChemE/curso-python-datos | notebooks/070-AEMET_APIREST.ipynb | bsd-3-clause | # preserve
from IPython.display import HTML
"""
Explanation: Cargando datos con API-REST
¿Qué es API-REST?
API es la Application Programming Interface, es decir nuestra forma de interactuar con una aplicación. REST quiere decir REpresentational State Transfer. Normalmente cuando hablamos de REST, estamos hablando de u... |
mykespb/jupyters | tester1.ipynb | mit | 2**1000
import datetime
d = datetime.date.today()
d.year, d.month, d.day
"""
Explanation: Test file 01
Play with python3 and math modules
End of explanation
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import special, optimize
f = lambda x: -special.jv(3, x)
sol = optimize.minimize(f, 1.0)
... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/art_and_science_of_ml/solutions/hyperparameter_tuning.ipynb | apache-2.0 | # Use the chown command to change the ownership of the repository
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
# Installing the latest version of the package
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: Performing the Hyperparameter tuning
Learning Objectives
1. Learn how t... |
hktxt/MachineLearning | PyTorch Tutorials/4. Data Loading and Processing Tutorial.ipynb | gpl-3.0 | from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
# Ignore warnings
import warnings
warnings.filterwar... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/nicam16-8s/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-8s', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: MIROC
Source ID: NICAM16-8S
Topic: Aerosol
Sub-Topics: Transport, Emissions, C... |
BadWizard/intro_programming | notebooks/more_functions.ipynb | mit | def thank_you(name):
# This function prints a two-line personalized thank you message.
print("\nYou are doing good work, %s!" % name)
print("Thank you very much for your efforts on this project.")
thank_you('Adriana')
thank_you('Billy')
thank_you('Caroline')
"""
Explanation: More Functions
Earlier we ... |
probml/pyprobml | notebooks/book1/13/flax_intro.ipynb | mit | import numpy as np
# np.set_printoptions(precision=3)
np.set_printoptions(formatter={"float": lambda x: "{0:0.5f}".format(x)})
import matplotlib.pyplot as plt
import jax
print(jax.__version__)
print(jax.devices())
from jax import lax, random, numpy as jnp
key = random.PRNGKey(0)
from typing import Any, Callable,... |
tritemio/PyBroMo | notebooks/PyBroMo - 5. Two-state dynamics - Dynamic smFRET simulation.ipynb | gpl-2.0 | from pathlib import Path
from textwrap import dedent, indent
import numpy as np
import tables
from scipy.stats import expon
import phconvert as phc
print('phconvert version:', phc.__version__)
SIM_PATH = 'data/'
filelist = list(Path(SIM_PATH).glob('smFRET_*_600s.hdf5'))
[f.name for f in filelist]
filename_a = str([f... |
mne-tools/mne-tools.github.io | 0.17/_downloads/89cc396ae40816c48694b5fe5505a690/plot_tf_dics.ipynb | bsd-3-clause | # Author: Roman Goj <roman.goj@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.event import make_fixed_length_events
from mne.datasets import sample
from mne.time_frequency import csd_fourier
from mne.beamformer import tf_dics
from mne.viz import plot_source_spectrogram
print(__doc__)
data_path = sample.d... |
SylvainCorlay/bqplot | examples/Introduction.ipynb | apache-2.0 | # Let's begin by importing some libraries we'll need
import numpy as np
# And creating some random data
size = 100
np.random.seed(0)
x_data = np.arange(size)
y_data = np.cumsum(np.random.randn(size) * 100.0)
"""
Explanation: bqplot
This notebook is meant to guide you through the first stages of using the bqplot visu... |
astrograzl/SymPyTut | notebooks/Linear-algebra.ipynb | bsd-3-clause | A = Matrix( [[ 2,-3,-8, 7],
[-2,-1, 2,-7],
[ 1, 0,-3, 6]] )
"""
Explanation: Linear algebra
A matrix $A \in \mathbb{R}^{m\times n}$ is a rectangular array of real numbers with $m$ rows and $n$ columns.
To specify a matrix $A$, we specify the values for its $mn$ components $a_{11}, a_{12}, \ld... |
shernshiou/CarND | Term1/02-CarND-Traffic-Sign-Classifier-Project/Traffic_Sign_Classifier.ipynb | mit | # Load pickled data
import pickle
import csv
import cv2
import numpy as np
import math
import matplotlib.pyplot as plt
signnames = []
with open("signnames.csv", 'r') as f:
next(f)
reader = csv.reader(f)
signnames = list(reader)
n_classes = len(signnames)
training_file = "./train.p"
testing_file = "./test.... |
ledeprogram/algorithms | class6/donow/radhika_pc_Class6_DoNow.ipynb | gpl-3.0 | import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt # package for doing plotting (necessary for adding the line)
import statsmodels.formula.api as smf # package we'll be using for linear regression
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
import numpy as np
plt.style.use(... |
caseyjlaw/FRB121102 | demo_FRB121102.ipynb | bsd-3-clause | %matplotlib inline
"""
Explanation: Demonstration of rtpipe analysis with FRB 121102
A walkthrough for data preparation, finding a transient, analyzing, visualizing to catch your own FRB
This notebook demonstrates the Python library rtpipe, which was used to make the first interferometric detection of a Fast Radio Bur... |
ryan-leung/SolvingProjectEuler | Q031-Q040.ipynb | bsd-3-clause | import numpy as np
coins=np.array([1,2,5,10,20,50,100,200])
n=200
max_coins=n/coins
mc=max_coins
c=coins
import itertools
for element in itertools.product(np.arange(mc[0]+1),np.arange(mc[1]+1),np.arange(mc[2]+1),np.arange(mc[3]+1),np.arange(mc[4]+1),np.arange(mc[5]+1),np.arange(mc[6]+1),np.arange(mc[7]+1)):
if np.... |
davek44/Basset | src/explore_dataset.ipynb | mit | import pandas as pd
activity_file = 'encode_roadmap_act.txt'
# activity_file = 'encode_roadmap_acc_50k.txt'
activity_df = pd.read_table(activity_file, index_col=0)
"""
Explanation: Let's load in the data to a panda DataFrame. A sample of the data is often better here so the routines run faster.
End of explanation
""... |
scotthuang1989/Python-3-Module-of-the-Week | internet/urllib.request — Network Resource Access.ipynb | apache-2.0 | from urllib import request
response = request.urlopen('http://localhost:8080/')
print('RESPONSE:', response)
print('URL :', response.geturl())
headers = response.info()
print('DATE :', headers['date'])
print('HEADERS :')
print('---------')
print(headers)
data = response.read().decode('utf-8')
print('LENGTH :... |
johnnyliu27/openmc | examples/jupyter/tally-arithmetic.ipynb | mit | import glob
from IPython.display import Image
import numpy as np
import openmc
"""
Explanation: This notebook shows the how tallies can be combined (added, subtracted, multiplied, etc.) using the Python API in order to create derived tallies. Since no covariance information is obtained, it is assumed that tallies are... |
Yu-Group/scikit-learn-sandbox | jupyter/backup_deprecated_nbs/24_wrapper_stability.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from sklearn.datasets import load_breast_cancer
import numpy as np
from functools import reduce
# Needed for the scikit-learn wrapper function
from sklearn.utils import resample
from sklearn.ensemble import RandomForestClassifier
from math import ceil
# Import our c... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_3d_to_2d.ipynb | bsd-3-clause | # Authors: Christopher Holdgraf <choldgraf@berkeley.edu>
#
# License: BSD (3-clause)
from scipy.io import loadmat
import numpy as np
from mayavi import mlab
from matplotlib import pyplot as plt
from os import path as op
import mne
from mne.viz import ClickableImage # noqa
from mne.viz import plot_alignment, snapshot_... |
biokit/biokit | notebooks/network/Complex.ipynb | bsd-2-clause | import biokit
%pylab inline
from biokit.network import complexes
"""
Explanation: Identifying Complexes in your Network of Protein-Protein Interactions
Contact:
http://github.com/cokelaer
http://thomas-cokelaer.info
Date: Feb 2015
Introduction
The assumption is that you have a network of protein-protein interactio... |
sorig/shogun | doc/ipython-notebooks/multiclass/multiclass_reduction.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
import numpy as np
from numpy import random
from scipy.io import loadmat
mat = loadmat(os.path.join(SHOGUN_DATA_DIR, 'multiclass/usps.mat'))
Xall = mat['data']
#normalize examples to have norm one
Xall = Xall... |
madHatter106/DataScienceCorner | posts/from-the-web-to-a-pandas-dataframe.ipynb | mit | import requests
import pandas as pd
import re
import numpy as np
import pickle
from IPython.core.display import display, HTML
display(HTML("<style>.container {width:90% !important;}</style>"))
"""
Explanation: In this post, I'm going to briefly describe how a I download the NASA bio-Optical Marine Algorithm Dataset o... |
amcdawes/QMlabs | Lab 8 - SHO Solutions.ipynb | mit | from numpy import sqrt
from qutip import *
"""
Explanation: Lab 8 - Simple Harmonic Oscillator states
Problems from Chapter 12
End of explanation
"""
N = 10 # pick a size for our state-space
a = destroy(N)
n = a.dag()*a
"""
Explanation: Define the standard operators
End of explanation
"""
a*a.dag() - a.dag()*a
... |
Bismarrck/tensorflow | tensorflow/examples/udacity/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.
from __future__ import print_function
import numpy as np
import tensorflow as tf
import time
from six.moves import cPickle as pickle
from six.moves import range
"""
Explanation: Deep Learning
Assignment 2
Previ... |
khalido/algorithims | binary_search.ipynb | gpl-3.0 | data = [i for i in range(10000)]
data[:10]
"""
Explanation: Binary Search:
start with a sorted list of data
see if the mid value is what we're looking for
if item is lower than the mid, make mid-1 the new high point
if item is higher than the mid, make mid+1 the new low point
keep going until list is exhausted or ite... |
SatoshiNakamotoGeoscripting/SatoshiNakamotoGeoscripting | Lecture 11/.ipynb_checkpoints/Satoshi Nakamoto Lecture 10 Jupyter Notebook-checkpoint.ipynb | mit | from numpy import mean
import os
from os import makedirs,chdir
from os.path import exists
"""
Explanation: Team: Satoshi Nakamoto <br>
Names: Alex Levering & Hèctor Muro <br>
Lesson 10 Exercise solution
Import standard libraries
End of explanation
"""
from osgeo import ogr,osr
import folium
import simplekml
"""
Exp... |
obust/Pandas-Tutorial | .ipynb_checkpoints/Pandas II - Working with DataFrames-checkpoint.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
pd.set_option('max_columns', 50)
"""
Explanation: Pandas II - Working with DataFrames
End of explanation
"""
# pass in column names for each CSV
u_cols = ['user_id', 'age', 'sex', 'occupation', 'zip_code']
df_users = pd.read_csv('data/MovieLens-... |
HrantDavtyan/Data_Scraping | 2018/Crawling.ipynb | apache-2.0 | #scraping
import time
import requests
from pprint import pprint
from bs4 import BeautifulSoup
#nltk
import nltk
from nltk.corpus import stopwords, wordnet
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.stem import PorterStemmer, WordNetLemmatizer
#nltk.download('popular', halt_on_error=False)
#textb... |
mdeff/cnn_graph | trials/2_classification.ipynb | mit | import time
import numpy as np
import scipy.sparse, scipy.sparse.linalg, scipy.spatial.distance
from sklearn import datasets, linear_model
import matplotlib.pyplot as plt
%matplotlib inline
import os
import sys
sys.path.append('..')
from lib import graph
"""
Explanation: Trial 2: classification with learned graph fil... |
liufuyang/deep_learning_tutorial | course-deeplearning.ai/course4-cnn/week4-facenet-nstyle/NeuralStyleTransfer/Art+Generation+with+Neural+Style+Transfer+-+v2.ipynb | mit | import os
import sys
import scipy.io
import scipy.misc
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
from PIL import Image
from nst_utils import *
import numpy as np
import tensorflow as tf
%matplotlib inline
"""
Explanation: Deep Learning & Art: Neural Style Transfer
Welcome to the second assi... |
gte620v/PythonTutorialWithJupyter | exercises/Ex3-Stock_Data_empty.ipynb | mit | import pandas as pd
from pandas_datareader import data, wb
import datetime
# We will look at stock prices over the past year, starting at January 1, 2016
start = datetime.datetime(2016,1,1)
end = datetime.date.today()
# Let's get Apple stock data; Apple's ticker symbol is AAPL
# First argument is the series we wan... |
e-sr/SDWirkungNi | DSP/DSPAuswertung.ipynb | cc0-1.0 | %reset -f
%matplotlib notebook
%load_ext autoreload
%autoreload 1
%aimport functions
import numpy as np
import copy
import acoustics
from functions import *
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
mpl.rcParams['lines.linewidth']=0.5
# uncomment next line to connect a qtconsole to ... |
thiagoqd/queirozdias-deep-learning | 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... |
awjuliani/DeepRL-Agents | Vanilla-Policy.ipynb | mit | import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
import gym
import matplotlib.pyplot as plt
%matplotlib inline
try:
xrange = xrange
except:
xrange = range
env = gym.make('CartPole-v0')
"""
Explanation: Simple Reinforcement Learning in Tensorflow Part 2-b:
Vanilla Policy Gradi... |
HaoMood/cs231n | assignment1/assignment1/two_layer_net.ipynb | gpl-3.0 | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.neural_net import TwoLayerNet
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloadi... |
ucsdlib/python-novice-inflammation | 4-files & conditionals.ipynb | cc0-1.0 | import glob
import numpy
import matplotlib.pyplot
"""
Explanation: We now have almost everything we need to process our data files, only thing missing is a library to grab files
End of explanation
"""
print(glob.glob('data/inflammation*.csv'))
"""
Explanation: glob contains function glob that finds files that match... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/cmip6/models/sandbox-3/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mpi-m', 'sandbox-3', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: MPI-M
Source ID: SANDBOX-3
Sub-Topics: Radiative Forcings.
Properties: 85 (4... |
madsenmj/ml-introduction-course | Class12/Class12.ipynb | apache-2.0 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import Perceptron, LogisticRegression
from sklearn.model_selection import train_test_split
import sklearn.metrics as metrics
#Returning to Class04 data
speeddf = pd.read_csv("../Class04/Class04_speed_data.csv",dtype={'Sp... |
jeroarenas/MLBigData | 0_Introduction/Intro_Python_3.ipynb | mit | import goslate # pip install goslate
from bs4 import BeautifulSoup # pip install beautifulsoup4
import urllib2 # pip install requests
"""
Explanation: A simple python application: universal translator
In this lab we will develop a universal text translator by using the Google translation webpage.
We will use the foll... |
metpy/MetPy | v0.12/_downloads/87fd6ee8be4ea1587fa2ad7f4206407a/Combined_plotting.ipynb | bsd-3-clause | import xarray as xr
from metpy.cbook import get_test_data
from metpy.plots import ContourPlot, ImagePlot, MapPanel, PanelContainer
from metpy.units import units
# Use sample NARR data for plotting
narr = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))
"""
Explanation: Combined Plotting
Demonstra... |
fdion/stemgraphic | notebooks/Quickstart with categoricals.ipynb | mit | %matplotlib inline
import pandas as pd
from stemgraphic.alpha import stem_graphic
"""
Explanation: stemgraphic quickstart with categorical
Import stem_graphic from stemgraphic.alpha
End of explanation
"""
df = pd.read_csv('../datasets/iris.csv')
df.describe(include='all')
"""
Explanation: Load a data frame
End of ... |
theandygross/TCGA_differential_expression | Notebooks/Downsampling.ipynb | mit | import NotebookImport
from Imports import *
matched_rna = pd.read_hdf(RNA_SUBREAD_STORE, 'matched_tn')
matched_rna = matched_rna.ix[ti((matched_rna == -3).sum(1) !=
len(matched_rna.columns))]
n = len(matched_rna.columns.levels[0])
dx_rna = binomial_test_screen(matched_rna, fc=1.)
dx_r... |
jellis18/enterprise | docs/_static/notebooks/usage.ipynb | mit | % matplotlib inline
%config InlineBackend.figure_format = 'retina'
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from enterprise.pulsar import Pulsar
import enterprise.signals.parameter as parameter
from enterprise.signals import utils
from enterprise.signals import signal_base
f... |
ireapps/cfj-2017 | exercises/17. Miscellaneous-working.ipynb | mit | humans = [
{'name': 'Cody', 'age': 32, 'job': 'Training director', 'height_in': 72},
{'name': 'Jeff', 'age': 44, 'job': 'Snake charmer', 'height_in': 60},
{'name': 'Sally', 'age': 55, 'job': 'Fry cook'}
]
for human in humans:
print(human['name'], 'is', human['height_in'], 'inches tall')
"""
Explanatio... |
explosion/thinc | examples/06_predicting_like_terms.ipynb | mit | !pip install "thinc>=8.0.0" mathy_core
"""
Explanation: Predicting Like Polynomial Terms
Remember in Algebra how you had to combine "like terms" to simplify problems?
You'd see expressions such as 60 + 2x^3 - 6x + x^3 + 17x in which there are 5 total terms but only 4 are "like terms".
2x^3 and x^3 are like, and -6x ... |
diging/networks | 3. Flow control. if, elif, else, and friends.ipynb | gpl-3.0 | import random # Ignore me for now!
"""
Explanation: Programming for Network Research
Erick Peirson, PhD | erick.peirson@asu.edu | @captbarberousse
Last updated 20 January, 2016
0. Introduction.
1. First steps with Python.
2. Objects and types.
3. Flow control: if, elif, else, and friends.
4. First steps with Netwo... |
paulmorio/grusData | basics/.ipynb_checkpoints/SupportVectorMachines-checkpoint.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# use seaborn plotting defaults
import seaborn as sns; sns.set()
"""
Explanation: Support Vector Machines
Support vector machines (SVMs) are a particularly powerful and flexible class of supervised algorithms for both classi... |
skidzo/pydy | examples/npendulum/n-pendulum-control.ipynb | bsd-3-clause | from IPython.display import SVG
SVG(filename='n-pendulum-with-cart.svg')
"""
Explanation: Introduction
Several pieces of the puzzle have come together lately to really demonstrate the power of the scientific python software packages to handle complex dynamic and controls problems (i.e. IPython notebooks, matplotlib an... |
florianwittkamp/FD_ACOUSTIC | JupyterNotebook/1D/FD_1D_DX4_DT4_ABS.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import time as tm
import matplotlib.pyplot as plt
"""
Explanation: FD_1D_DX4_DT4_ABS 1-D acoustic Finite-Difference modelling
GNU General Public License v3.0
Author: Florian Wittkamp
Finite-Difference acoustic seismic wave simulation
Discretization of the first-order acoustic wave... |
iamfullofspam/hep_ml | notebooks/BoostingToUniformity.ipynb | apache-2.0 | # downloading data
!wget -O ../data/dalitzdata.root -nc https://github.com/arogozhnikov/hep_ml/blob/data/data_to_download/dalitzdata.root?raw=true
# we are installing rep for nice plots and reports here
!pip install rep --no-dependencies
import pandas, numpy
from sklearn.model_selection import train_test_split
from s... |
cosmicBboy/cosmicBboy.github.io | _site/notebooks/2018-12-28-validating-pandas-dataframes.ipynb | gpl-2.0 | import logging
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from collections import OrderedDict
from IPython.display import display, Markdown
from sodapy import Socrata
logging.disable(logging.WARNING)
# utility function to print python output as markdown snippets
def print_output(s):
... |
maxis42/ML-DA-Coursera-Yandex-MIPT | 2 Supervised learning/Homework/6 bagging and random forest/Bagging and random forest.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from sklearn.datasets import load_digits
from sklearn.model_selection import cross_val_score, validation_curve
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import BaggingClassifier, RandomForestClassifier
import numpy as np
import seaborn as... |
lukemans/Hello-world | t81_558_class1_intro_python.ipynb | apache-2.0 | # What version of Python do you have?
import sys
import tensorflow as tf
import sklearn as sk
import pandas as pd
print("Python {}".format(sys.version))
print('TensorFlow {}'.format(tf.__version__))
print('Pandas {}'.format(pd.__version__))
print('Scikit-Learn {}'.format(sk.__version__))
"""
Explanation: T81-558: Ap... |
kabrapratik28/Stanford_courses | cs231n/assignment3/GANs-PyTorch.ipynb | apache-2.0 | import torch
import torch.nn as nn
from torch.nn import init
from torch.autograd import Variable
import torchvision
import torchvision.transforms as T
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.data import sampler
import torchvision.datasets as dset
import numpy as np
import ... |
ppham27/MLaPP-solutions | chap08/1.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
from classifiers import read_spam_data, transform_log, transform_binary
#from sklearn.linear_model import LogisticRegression # reference sklearn implementation
from classifiers import LogisticRegression
train_data, test_data = read_spam_data()
train_data.head(... |
metpy/MetPy | v0.10/_downloads/e8749c670d85c7ee86146b51f47ef020/unit_tutorial.ipynb | bsd-3-clause | import numpy as np
from metpy.units import units
"""
Explanation: Units Tutorial
Early in our scientific careers we all learn about the importance of paying
attention to units in our calculations. Unit conversions can still get the best
of us and have caused more than one major technical disaster, including the
crash... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/matching_engine/sdk_matching_engine_for_indexing.ipynb | apache-2.0 | PROJECT_ID = "<your_project_id>" # @param {type:"string"}
NETWORK_NAME = "my-vpc-network" # @param {type:"string"}
PEERING_RANGE_NAME = "my-haystack-range"
# Create a VPC network
! gcloud compute networks create {NETWORK_NAME} --bgp-routing-mode=regional --subnet-mode=auto --project={PROJECT_ID}
# Add necessary f... |
DistrictDataLabs/yellowbrick | examples/exbald/data/testing.ipynb | apache-2.0 | import pandas as pd
%matplotlib inline
dataset = pd.read_csv('dataset.csv')
dataset.head(5)
dataset.count_total.describe()
#add a new column to create a binary class for room occupancy
countmed = dataset.count_total.median()
dataset['room_occupancy'] = dataset['count_total'].apply(lambda x: 'occupied' if x > 4 els... |
arongdari/digbeta | tour/notes.ipynb | gpl-3.0 | cut -d $'\t' -f1,11,12 yfcc100m_dataset >> dataset.yfcc
"""
Explanation: Reproduce the Results of the IJCAI'15 Paper
<a id='toc'></a>
1. Dataset
1. POI Geo-coordinates
1. Recommend Itinerary
1. Issues
1. Results
* POI Popularity
* Time-based User Interest
* Frequency-based User Interest
* Precision, Recall and F1-... |
EmuKit/emukit | emukit/examples/spread_of_disease-with_seir_model/Emukit-task-spread-of-disease-with-seir-model.ipynb | apache-2.0 | # General imports
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
# Figure config
colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS)
LEGEND_SIZE = 15
TITLE_SIZE = 25
AXIS_SIZE = 15
FIGURE_SIZE = (12, 8)
# for reproducibility
np.random.seed(42)
"""
Explanation: Sprea... |
Juanlu001/poliastro | docs/source/examples/CZML Tutorial.ipynb | mit | from poliastro.czml.extract_czml import CZMLExtractor
from poliastro.examples import molniya
"""
Explanation: Visualize orbital data with Cesium
Poliastro allows users to easily convert orbital data to CZML, a JSON format primarily used in applications running Cesium
Dependencies
You will only need poliastro (obvious... |
dhyeon/ingredient2vec | src/src_old/plot_ingredients_recipes.ipynb | apache-2.0 | import os
import sklearn.manifold
import matplotlib.pyplot as plt
import h5py
import plotly.plotly as py
import plotly.graph_objs as go
import plotly.offline as offline
import numpy as np
import collections
import pandas as pd
import itertools
import seaborn as sns
import time
import json
import re
from sklearn.manifol... |
gregstarr/PyGPS | Examples/.ipynb_checkpoints/Rideout method TEC plots-checkpoint.ipynb | agpl-3.0 | fig = plt.figure(figsize=(14,14))
tlim = 4000
minpoints = 3000
svs_with_pts_in_range = [i for i in data.items if(np.sum(np.logical_and.reduce(
(data[data.labels[:tlim],i,'L1','data']>0,
data[data.labels[:tlim],i,'L2','data']>0,
data[data.labels[:tlim],i,'C1','data']>0,... |
ebonnassieux/fundamentals_of_interferometry | 8_Calibration/8_1_calibration_least_squares_problem.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
"""
Explanation: Outline
Glossary
8. Calibration
Previous: 8. Calibration
Next: 8.2 1GC calibration
Format status:
<span style="background-color:green"> &nbs... |
iamtrask/polyglot | notebooks/Embeddings.ipynb | gpl-3.0 | from polyglot.mapping import Embedding
"""
Explanation: Word Embeddings
Word embedding is a mapping of a word to a d-dimensional vector space.
This real valued vector representation captures semantic and syntactic features.
Polyglot offers a simple interface to load several formats of word embeddings.
End of explanati... |
planetlabs/notebooks | jupyter-notebooks/forest-monitoring/drc_roads_temporal_analysis.ipynb | apache-2.0 | import datetime
from functools import reduce
import json
import os
import numpy as np
import pandas as pd
from planet import api
import rasterio
from sklearn.cluster import MiniBatchKMeans
from sklearn.ensemble import RandomForestClassifier
from utils import Timer
import visual
# Import functionality from local note... |
ceos-seo/data_cube_notebooks | notebooks/urbanization/Urbanization_Using_NDBI.ipynb | apache-2.0 | import sys
import os
sys.path.append(os.environ.get('NOTEBOOK_ROOT'))
import matplotlib.pyplot as plt
import xarray as xr
from utils.data_cube_utilities.dc_display_map import display_map
from utils.data_cube_utilities.dc_rgb import rgb
from utils.data_cube_utilities.urbanization import NDBI
from utils.data_cube_util... |
cosmir/dev-set-builder | notebooks/FMA subsampling.ipynb | mit | import numpy as np
import pandas as pd
import entrofy
import matplotlib.pyplot as plt
%matplotlib nbagg
df = pd.read_csv('/home/bmcfee/data/vggish-likelihoods-a226b3-maxagg10.csv.gz', index_col=0)
df.head(5)
(df >= 0.5).describe().T.sort_values('freq')
df.median()
"""
Explanation: 2018-01-12 / FMA sub-sampling
... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session02/Day4/AdvancedNeuralNetworkExercise.ipynb | mit | # Imports / plotting configuration
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('poster')
plt.rcParams['image.cmap'] = 'viridis'
np.random.seed(13)
import json
import os
# Change this to `'tensorflow'` if you prefer
backend = 'theano'
config = {'image_dim... |
BONSAMURAIS/bonsai | legacy-examples/Leontive inverse tutorial - investments are NOT integrated.ipynb | bsd-3-clause | HIOT_FD = "/Users/marie/Desktop/MR_HIOT_2011_v3.3.11.xlsx"
import pandas as pd
import csv
### MR-HIOT.csv is created because the excel is too heavy
data_xls = pd.read_excel(HIOT_FD, 'HIOT', index_col=None)
data_xls.to_csv('MR_HIOT.csv', encoding='utf-8')
### FD.csv is created because the excel is too heavy
data_xls = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.