repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
mne-tools/mne-tools.github.io
0.20/_downloads/243172b1ef6a2d804d3245b8c0a927ef/plot_60_maxwell_filtering_sss.ipynb
bsd-3-clause
import os import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False) raw.crop(tmax=60).load_data() """ Explanation: ...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/image_classification/labs/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...
mne-tools/mne-tools.github.io
stable/_downloads/87ced9add160fc358769ef662f31e446/45_projectors_background.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # noqa from scipy.linalg import svd import mne def setup_3d_axes(): ax = plt.axes(projection='3d') ax.view_init(azim=-105, elev=20) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('z') ax....
jorgemauricio/INIFAP_Course
ejercicios/Seaborn/4_Graficas_Regresion.ipynb
mit
import seaborn as sns %matplotlib inline tips = sns.load_dataset('tips') tips.head() """ Explanation: Regression Plots Seaborn has many built-in capabilities for regression plots, however we won't really discuss regression until the machine learning section of the course, so we will only cover the lmplot() function ...
robertoalotufo/ia898
dev/2017-01-20-RAL-Experimentando conversar página do Adessowiki.ipynb
mit
import numpy as np a = np.arange(6) b = a print "a =\n",a print "b =\n",b b.shape = (2,3) # mudança no shape de b, print "\na shape =",a.shape # altera o shape de a b[0,0] = -1 # mudança no conteúdo de b print "a =\n",a ...
dato-code/tutorials
strata-sj-2016/time-series/time_series_data_object.ipynb
apache-2.0
import datetime as dt import graphlab as gl sf = gl.SFrame.read_csv('raw_data/global_earthquakes.csv', verbose=False) """ Explanation: 1. The data: global earthquake events I pulled the data from the USGS Advanced National Seismic System Comprehensive Earthquake Catalog. - http://earthquake.usgs.gov/data/ - http://ea...
kringen/IOT-Back-Brace
web_api/webServiceToKafka.ipynb
apache-2.0
from flask import Flask, Response, request, json, render_template from kafka import KafkaProducer import uuid import datetime app = Flask(__name__) producer = KafkaProducer(bootstrap_servers='localhost:9092') """ Explanation: REST API for IoT Back Brace - WebServiceToKafka.py This script creates a Flask web api runn...
sujitpal/intro-dl-talk-code
src/05-alice-rnn-langmodel.ipynb
unlicense
from __future__ import division, print_function from keras.layers.recurrent import SimpleRNN from keras.models import Sequential from keras.layers import Dense, Activation from keras.utils.visualize_util import plot import numpy as np %matplotlib inline """ Explanation: Learning to speak like Alice A generative charac...
GoogleCloudPlatform/training-data-analyst
quests/data-science-on-gcp-edition1_tf2/05_bqnotebook/exploration.ipynb
apache-2.0
a = 3 b = a + 5 print("a={} b={}".format(a,b)) """ Explanation: <h1> 5. Interactive Data Analysis </h1> This notebook introduces carrying out interactive data analysis of data in BigQuery using Cloud Datalab. This cell, for example, is a mark-down cell. Which is why you are seeing text. The cell that follows is a Py...
susantabiswas/Natural-Language-Processing
Notebooks/Testing_Training_Quadgram.ipynb
mit
from nltk.util import ngrams from collections import defaultdict from collections import OrderedDict import string import time import gc start_time = time.time() """ Explanation: Word prediction using Quadgram This program reads the corpus line by line.This reads the corpus one line at a time loads it into the memory...
phoebe-project/phoebe2-docs
2.1/tutorials/intens_weighting.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" """ Explanation: Intensity Weighting Setup Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ %matplotlib inline ...
ds-modules/LINGUIS-110
Intro/Intro.ipynb
mit
print("Hello, World!") """ Explanation: Linguistics 110 Professor Susan Lin This introductory notebook will familiarize you with some of the basic strategies for data analysis that will be useful to you throughout the course. It will cover an overview of our software and an introduction to programming. Table of Conten...
apozas/BIST-Python-Bootcamp
2_Introduction_to_Python.ipynb
gpl-3.0
print('Hello, world!') 2 + 2 import numpy """ Explanation: 2 Introduction to Python A series of commands to introduce beginners to Python. Does it work? End of explanation """ a_integer = 5 a_float = 1.41421356237 a_integer + a_float a_number = a_integer + a_float print(a_number) a_string = 'How you doi...
cliburn/sta-663-2017
notebook/Extras_02_Functional_Word_Counting.ipynb
mit
text = ''''Twas brillig, and the slithy toves Did gyre and gimble in the wabe; All mimsy were the borogoves, And the mome raths outgrabe. 'Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!' H...
SlipknotTN/udacity-deeplearning-nanodegree
sentiment-rnn/Sentiment RNN Solution With Logs.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...
diging/methods
1.7. Latent Dirichlet Allocation/1.7.2 Finding concepts in texts - Hierarchical Dirichlet Process.ipynb
gpl-3.0
import nltk from tethne.readers import zotero import matplotlib.pyplot as plt from nltk.corpus import stopwords import gensim import networkx as nx import pandas as pd wordnet = nltk.WordNetLemmatizer() stemmer = nltk.SnowballStemmer('english') stoplist = stopwords.words('english') text_root = '../data/EmbryoProject...
ES-DOC/esdoc-jupyterhub
notebooks/niwa/cmip6/models/sandbox-2/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'niwa', 'sandbox-2', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NIWA Source ID: SANDBOX-2 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balan...
tensorflow/docs-l10n
site/ja/guide/tf_numpy.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...
OpenTire/OpenTire
examples/Moment_Diagram_Example.ipynb
mit
from opentire import OpenTire from opentire.Core import TireState import numpy as np import matplotlib.pyplot as plt """ Explanation: OpenTire Moment Method Example Draws a constant velocity force-moment diagram of a bicycle using the OpenTire library Import OpenTire and other libraries used in this demonstration End...
mpschr/mutex
MutEx and CoOc test in python.ipynb
mit
import numpy as np import pandas as pd import scipy.sparse as sparse import random """ Explanation: Permuation based Mutual Exclusive and Co-occurrence for group of items End of explanation """ row, col = 100, 100 np.random.seed(77) df = pd.DataFrame(sparse.random(row, col, density=0.15).A).apply(np.ceil) df.loc[0]...
brianray/puppy_dec_2015
.ipynb_checkpoints/Feature Engineering for Text Data-checkpoint.ipynb
apache-2.0
reviews = gl.SFrame.read_csv('../data/yelp/yelp_training_set_review.json', header=False) reviews reviews[0] """ Explanation: SFrame -- Scalable Dataframe Powerful unstructured data processing: read straight up json End of explanation """ reviews=reviews.unpack('X1','') reviews """ Explanation: Unpack to extract st...
rob-dalton/dsi-alumni-lectures
web_scraping/Web Scraping.ipynb
mit
# url = 'https://www.tripadvisor.com/Attraction_Review-g60878-d3184389-Reviews-Chihuly_Garden_and_Glass-Seattle_Washington.html#REVIEWS' def get_reviews(response): # response = requests.get(url) soup = BeautifulSoup(response, 'html.parser') entries = soup.findAll('div', {'class': 'entry'}) reviews = [e...
tensorflow/docs-l10n
site/ko/hub/tutorials/text_classification_with_tf_hub_on_kaggle.ipynb
apache-2.0
# Copyright 2018 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...
mne-tools/mne-tools.github.io
0.19/_downloads/063df3a44a4ac9d23978d7b307e69a4e/plot_read_evoked.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) from mne import read_evokeds from mne.datasets import sample print(__doc__) data_path = sample.data_path() fname = data_path + '/MEG/sample/sample_audvis-ave.fif' # Reading condition = 'Left Auditory' evoked = read_evokeds(fname...
raschuetz/foundations-homework
09/homework-9-schuetz.ipynb
mit
earthquake = { 'rms': '1.85', 'updated': '2014-06-11T05:22:21.596Z', 'type': 'earthquake', 'magType': 'mwp', 'longitude': '-136.6561', 'gap': '48', 'depth': '10', 'dmin': '0.811', 'mag': '5.7', 'time': '2014-06-04T11:58:58.200Z', 'latitude': '59.0001', 'place': '73km WSW of Haines, Alaska', 'net': 'us', '...
neilpquinn/2016-02-notifications-exploration
Notifications research.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.axes as ax %matplotlib inline notifs = pd.read_table("./notifications_per_user.tsv") unreads = pd.read_table("./unread_notifications_per_user.tsv") wikis = set(notifs["wiki"]) notifs.tail() def filter_by_wiki( df, wiki ): r...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/sandbox-2/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-2', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: SANDBOX-2 Topic: Seaice Sub-Topics: Dynami...
yunqu/PYNQ
docs/source/jupyter_notebooks_advanced_features.ipynb
bsd-3-clause
import random the_number = random.randint(0, 10) guess = -1 name = input('Player what is your name? ') while guess != the_number: guess_text = input('Guess a number between 0 and 10: ') guess = int(guess_text) if guess < the_number: print(f'Sorry {name}, your guess of {guess} was too LOW.\n') ...
mclaughlin6464/pearce
notebooks/Pearce wt integral tests.ipynb
mit
from pearce.mocks import cat_dict import numpy as np from os import path from astropy.io import fits import matplotlib #matplotlib.use('Agg') from matplotlib import pyplot as plt %matplotlib inline import seaborn as sns sns.set() """ Explanation: I've implemented the integral of wt in pearce. This notebook verifies i...
kingsgeocomp/code-camp
notebook-12-packages.ipynb
mit
from urllib.request import urlopen print("dir(urlopen) returns:\n") print(dir(urlopen)) print("\n\n") print("help(urlopen) returns:\n") print(help(urlopen)) # Notice! """ Explanation: Notebook-12: Introduction to Packages Functions vs. Packages We saw in a previous Code Camp Lesson how functions are a useful programmi...
mdeff/ntds_2017
projects/reports/brain_network/2_2_ntds_project_network_WeightedSpectralGraphTheory.ipynb
mit
##force not printing %%capture %matplotlib inline !pip install h5py import numpy as np import numpy.ma as ma import h5py from scipy import sparse import IPython.display as ipd import matplotlib.pyplot as plt import matplotlib.colors as col from mpl_toolkits.mplot3d import Axes3D import re import networkx as nx import...
brandoncgay/deep-learning
autoencoder/Convolutional_Autoencoder.ipynb
mit
%matplotlib inline 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', validation_size=0) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
jagarzone6/cmos
notebooks/.ipynb_checkpoints/Cmos - Transistors (variant KP property)-checkpoint.ipynb
mit
from IPython.core.display import Image, display display(Image(url='images/TipicalValuesLongChannel.png')) """ Explanation: 02 - Transistors Model for not uniform wafer (variant KP property) Definicion de variables para calcular el Kp que varia sobre la oblea End of explanation """ %matplotlib inline import math impo...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/gapic/custom/showcase_custom_text_binary_classification_online_container.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 text binary classification model with custom contain...
infilect/ml-course1
keras-notebooks/advanced/8.3-neural-style-transfer.ipynb
mit
from keras.preprocessing.image import load_img, img_to_array # This is the path to the image you want to transform. target_image_path = '/home/ubuntu/data/portrait.png' # This is the path to the style image. style_reference_image_path = '/home/ubuntu/data/popova.jpg' # Dimensions of the generated picture. width, heig...
mapio/programming-with-escher
notebook.ipynb
gpl-3.0
f """ Explanation: Programming with Escher This notebook is a collection of preliminary notes about a "code camp" (or a series of lectures) aimed at young students inspired by the fascinating Functional Geometry paper of Peter Henderson. In such work the Square Limit woodcut by Maurits Cornelis Escher is reconstructed...
CalPolyPat/phys202-2015-work
assignments/project/NeuralNetworks.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from IPython.html.widgets import interact from sklearn.datasets import load_digits digits = load_digits() print(digits.data.shape) def show_digit(i): plt.matshow(digits.images[i]); interact(show_digit, i=(0,100)); """ Explanation: Neural Networks This project w...
DaveBackus/Data_Bootcamp
Code/Lab/MEPS_data_experiment_Brian.ipynb
mit
import pandas as pd #The data package import sys #The code below wont work for any versions before Python 3. This just ensures that (I guess). assert sys.version_info >= (3,5) """ The MEPS dataset is is compressed in a .zip file in the link above. The code here downloads the .zip file, unzips and saves t...
Cyberface/nrutils_dev
examples/core_ipython_example.ipynb
mit
# Setup enviroment to autoreload packages %load_ext autoreload %autoreload 2 # Turn on inline plotting with matplotlib, and import needed thigs from nrutils %matplotlib inline from nrutils import scsearch,gwylm """ Explanation: Core example for nrutils: Find a simulation, load and plot waveform data Let's start by imp...
gtatiya/FlashVocab
docs/week4/TextProcessing.ipynb
gpl-3.0
#INPUT #folder = 'sample' # create this folder and place the exported file folder = 'all' #export_filename = 'English_Vocabulary_Sample.csv' export_filename = 'English_Vocabulary3.csv' """ Generate a dictionary from Anki export file. Note: Only GRE words have proper Serial No. Rest words have 99999 as Serial No. """ ...
ethen8181/machine-learning
model_selection/auc/auc.ipynb
mit
# code for loading the format for the notebook import os # path : store the current path to convert back to it later path = os.getcwd() os.chdir(os.path.join('..', '..', 'notebook_format')) from formats import load_style load_style(plot_style=False) os.chdir(path) # 1. magic for inline plot # 2. magic to print vers...
Jackporter415/phys202-2015-work
assignments/assignment10/ODEsEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 1 Imports End of explanation """ def lorentz_derivs(yvec, t, sigma, rho, beta): """Compute the the de...
bMzi/ML_in_Finance
0101_GettingStartedWithPython.ipynb
mit
from IPython.display import YouTubeVideo from datetime import timedelta YouTubeVideo('jZ952vChhuI') """ Explanation: Getting Started With Python Installation There are various ways to install Python. Assuming the reader is not (yet) well versed in programming, I suggest to download the Anaconda distribution, which wo...
scoyote/RHealthDataImport
.ipynb_checkpoints/ImportAppleHealthXML-checkpoint.ipynb
mit
import xml.etree.ElementTree as et import pandas as pd import numpy as np from datetime import * import matplotlib.pyplot as plt import re import os.path import zipfile %matplotlib inline plt.rcParams['figure.figsize'] = 16, 8 """ Explanation: Download, Parse and Interrogate Apple Health Export Data The first part...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/03_model_performance/b_feature_engineering_wd.ipynb
apache-2.0
import tensorflow as tf import numpy as np import shutil print(tf.__version__) """ Explanation: More Feature Engineering - Wide and Deep models Learning Objectives * Build a Wide and Deep model using the appropriate Tensorflow feature columns Introduction In this notebook we'll use what we learned about feature col...
malogrisard/NTDScourse
algorithms/02_sol_clustering.ipynb
mit
# Load libraries # Math import numpy as np # Visualization %matplotlib notebook import matplotlib.pyplot as plt plt.rcParams.update({'figure.max_open_warning': 0}) from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy import ndimage # Print output of LFR code import subprocess # Sparse matrix import ...
SSQ/Coursera-UW-Machine-Learning-Classification
Programming Assignment 6/Decision Trees in Practice.ipynb
mit
import numpy as np import pandas as pd import json """ Explanation: Decision Trees in Practice In this assignment we will explore various techniques for preventing overfitting in decision trees. We will extend the implementation of the binary decision trees that we implemented in the previous assignment. You will have...
jason-neal/companion_simulations
Notebooks/chi2_parameter_broadcasting.ipynb
mit
import numpy as np import scipy as sp from scipy.stats import chisquare import matplotlib.pyplot as plt % matplotlib inline """ Explanation: Interpolate wavelength on multiple dimensions Jason Neal - 19th July 2017 To try and interpolate N-D data along the first axis. This is to be able to perfrom chisquare analsysis...
WNoxchi/Kaukasos
misc/MeanShift_tutorial_1_sentdex.ipynb
mit
centers = [[1,1],[5,5]] X, y = make_blobs(n_samples=500, centers=centers, cluster_std=1) plt.scatter(X[:,0], X[:,1], s = 10) plt.show() """ Explanation: make_blobs is going to make blobs of data based on std dev. & some randomness around a specified point. You can specify how many points to generate in the blob, and t...
sthiele/pyasp
pyasp_demo.ipynb
gpl-3.0
from urllib.request import urlretrieve urlretrieve('http://sthiele.github.io/data/queens.lp','queens.lp') urlretrieve('http://sthiele.github.io/data/facts.lp','facts.lp') """ Explanation: PyASP basics In the following I try to explain the basics on how to use the PyASP library. I assume that pyasp is already installed...
gonmolina/CCE_ProblemasResueltos
ProbsVVEE/Levitador Magnetico/Problema Levitador Magnético-Python.ipynb
mit
import numpy as np import control as ctrl import matplotlib.pylab %matplotlib inline A=np.matrix("-20 100 2000;1 0 0;0 1 0") B=np.matrix("1;0;0") C=np.matrix("0 0 -40") D=np.matrix("0"); sys=ctrl.ss(A,B,C,D) """ Explanation: Selección de Polos del Controlador Para selecccionar del sistema a lazo cerrado debemos tener...
kit-cel/wt
sigNT/signals_transforms/sampling.ipynb
gpl-2.0
import numpy as np from scipy import signal import matplotlib import matplotlib.pyplot as plt %matplotlib inline # plotting options font = {'size' : 20} plt.rc('font', **font) plt.rc('text', usetex=True) matplotlib.rc('figure', figsize=(18, 6) ) """ Explanation: Content and Objective Show application of sinc ...
keras-team/keras-io
examples/vision/ipynb/cct.ipynb
apache-2.0
!pip install -U -q tensorflow-addons """ Explanation: Compact Convolutional Transformers Author: Sayak Paul<br> Date created: 2021/06/30<br> Last modified: 2021/06/30<br> Description: Compact Convolutional Transformers for efficient image classification. As discussed in the Vision Transformers (ViT) paper, a Transform...
planet-os/notebooks
nasa-opennex/Processing Large Datasets with the CSV Module.ipynb
mit
import csv import urllib2 """ Explanation: Processing Large Datasets with the CSV Module This notebook illustrates how the csv module can be used to incrementally process a large subset of OpenNEX DCP30 data in Python. In this example, we'll identify the minimum and maximum temperatures in the continental United State...
rawrgulmuffins/presentation_notes
pycon2016/tutorials/computation_statistics/hypothesis.ipynb
mit
%matplotlib inline from __future__ import print_function, division import numpy import scipy.stats import matplotlib.pyplot as pyplot from ipywidgets import interact, interactive, fixed import ipywidgets as widgets import first # seed the random number generator so we all get the same results numpy.random.seed(19)...
mrcinv/matpy
01c_kompleksna.ipynb
gpl-2.0
1j**2 # 1j je v Pythonu imaginarna enota type(2+2.2j) #kompleksna števila imajo v Pythonu svoj tip """ Explanation: ^ gor: Uvod Kompleksna števila V Pythonu so kompleksna števila vgrajena. Imaginarna enota se imenuje j in jo postavimo neposredno za številko. End of explanation """ z = (1-2j)/(1+1j) #Python zlahka o...
Cyianor/smc2017
solutions/code/Python/fheld/prep.ipynb
mit
import numpy as np from scipy.stats import norm %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns sns.set_style() """ Explanation: SMC2017: Preparatory exercises These problems are meant for repetition and to get familiar with some commonly used functions in the chosen language. Setup End of e...
computationalevolutionarydynamics/repeatedmistakes
notebooks/Final_Presentation.ipynb
gpl-3.0
from repeatedmistakes.strategies import SuspiciousTitForTat, TitForTat from repeatedmistakes.repeatedgame import RepeatedGame my_game = RepeatedGame(SuspiciousTitForTat, TitForTat) simulation_results = my_game.simulate(10) print("STFT: " + str(simulation_results[SuspiciousTitForTat])) print("TFT: " + str(simulation_re...
swirlingsand/deep-learning-foundations
sentiment-network/Sentiment Classification - Mini Project 3.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
aakashm301/Workshop
Refactored_Py_DS_ML_Bootcamp-master/05-Data-Visualization-with-Matplotlib/01-Matplotlib Concepts Lecture.ipynb
gpl-3.0
import matplotlib.pyplot as plt """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> Matplotlib Overview Lecture Introduction Matplotlib is the "grandfather" library of data visualization with Python. It was created by John Hunter. He created it to try to replicate MatLab'...
xdnian/pyml
assignments/ex04_ch0405_xdnian.ipynb
mit
import pandas as pd wine_data_remote = 'https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data' wine_data_local = '../datasets/wine/wine.data' df_wine = pd.read_csv(wine_data_remote, header=None) df_wine.columns = ['Class label', 'Alcohol', 'Malic acid', 'Ash', ...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/image_classification/solutions/3_tf_hub_transfer_learning.ipynb
apache-2.0
import os import pathlib from PIL import Image import IPython.display as display import matplotlib.pylab as plt import numpy as np import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.layers import ( Conv2D, Dense, Dropout, Flatten, MaxPooling2D, Softmax) import tensorflow_hub as h...
maxis42/ML-DA-Coursera-Yandex-MIPT
2 Supervised learning/Homework/4 metriks in sklearn/MetricsPA.ipynb
mit
import numpy as np from matplotlib import pyplot as plt import seaborn %matplotlib inline """ Explanation: Сравнение метрик качества бинарной классификации Programming Assignment В этом задании мы разберемся, в чем состоит разница между разными метриками качества. Мы остановимся на задаче бинарной классификации (с отк...
karhohs/boardgame-bookie
boardgames/seafall/notebooks/Ship Damage Probability.ipynb
bsd-3-clause
%matplotlib inline import itertools import matplotlib import matplotlib.pyplot import numpy import os import pandas import scipy.misc import scipy.special import seaborn # colormap for data visualizations cmap = seaborn.cubehelix_palette(n_colors = 20, start = 0.8, rot = 0.75, gamma = ...
pmgbergen/porepy
tutorials/get_started.ipynb
gpl-3.0
import numpy as np import scipy.sparse as sps import porepy as pp """ Explanation: Get started In this tutorial we investigate how to solve single-phase flow in PorePy using a two-point flux approximation.<br> Let is $\Omega$ a regular domain with boundary $\partial \Omega$. The boundary can be divided in two non-over...
pkimes/benchmark-fdr
datasets/microbiome/explore_schubert_sb_results.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline sns.set_style('white') fpvals = 'schubert-sb-table.txt' fotu = 'data/cdi_schubert_results/RDP/cdi_schubert.otu_table.100.denovo.rdp_assigned' fmeta = 'data/cdi_schubert_results/cdi_schubert.metadata.txt' ...
bmorris3/salter
stats_archive.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = "retina" from salter import (LightCurve, subtract_add_divide, concatenate_transit_light_curves, Residuals, lc_archive, planet_props) import matplotlib.pyplot as plt import numpy as np import warnings from astropy.stats import mad_std from it...
joonasfo/python
Assignment_06.ipynb
mit
# Initial import statements %matplotlib notebook import matplotlib.pyplot as plt import numpy as np import sympy as sy from matplotlib.pyplot import * from numpy import * from numpy.linalg import * from sympy import * """ Explanation: Assignment: 06 Applications Introduction to Numerical Problem Solving, Spring 2017 ...
gregunz/ada2017
exam/cheatsheet.ipynb
mit
# data science import pandas as pd import numpy as np import scipy.stats as stats from sklearn import linear_model # or others # plot import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline sns.set(rc={"figure.figsize": (15, 6)}) sns.set_palette(sns.color_palette("Set2", 10)) #sns.set_style("whitegri...
elizabetht/deep-learning
intro-to-rnns/Anna_KaRNNa.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
onyxfish/journalism
tutorial.ipynb
mit
import agate """ Explanation: The Agate Tutorial The best way to learn to use any tool is to actually use it. In this tutorial we will use agate to answer some basic questions about a dataset. The data we will be using is a copy of the National Registry of Exonerations made on August 28th, 2015. This dataset lists ind...
cdawei/digbeta
dchen/tour/generated_data.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import os, pickle, random import pandas as pd import numpy as np import cvxopt import seaborn as sns random.seed(1234554321) np.random.seed(123456789) cvxopt.base.setseed(123456789) """ Explanation: Experiment on Generated Data The goal of this notebook is to design...
phanrahan/magmathon
notebooks/signal-generator/solutions/Square.ipynb
mit
import matplotlib.pyplot as plt import numpy as np %matplotlib inline x = np.arange(0, 100) def square(x): return (x % 50) < 25 plt.plot(x, square(x)) import magma as m m.set_mantle_target("ice40") """ Explanation: Square Wave Generator A square wave is a periodic waveform that alternates between two discrete ...
jupyter/nbgrader
nbgrader/tests/preprocessors/files/test_taskcell.ipynb
bsd-3-clause
def squares(n): """Compute the squares of numbers from 1 to n, such that the ith element of the returned list equals i^2. """ ### BEGIN SOLUTION if n < 1: raise ValueError("n must be greater than or equal to 1") return [i ** 2 for i in range(1, n + 1)] ### END SOLUTION """ Exp...
phoebe-project/phoebe2-docs
development/tutorials/logg.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: Surface Gravity (logg) Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units import numpy as np...
AlexandruValeanu/365-days-of-algorithms
Day 10 - Karatsuba multiplication.ipynb
gpl-3.0
import numpy as np # used for generating random numbers """ Explanation: Definition(s) The Karatsuba algorithm is a fast multiplication algorithm. It reduces the multiplication of two n-digit numbers to at most ${\displaystyle n^{\log _{2}3}\approx n^{1.585}}$ single-digit multiplications in general. End of explanat...
phoebe-project/phoebe2-docs
2.2/tutorials/passbands.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Adding new passbands to PHOEBE In this tutorial we will show you how to add your own passband to PHOEBE. Adding a custom passband involves: downloading and setting up model atmosphere tables; providing a passband transmission function; defining and registering pass...
sfegan/calin
examples/calib/gain estimation from photostatistics.ipynb
gpl-2.0
%pylab inline import calin.ix.scripts.compute_diagnostics import calin.io.sql_transceiver import calin.diagnostics.waveform import calin.diagnostics.functional import calin.plotting sql = calin.io.sql_transceiver.SQLite3Transceiver("/CTA/diagnostics.sqlite", calin.io.sql_transceiver.SQLite3Transceiver.READ_ONLY) dia...
AllenDowney/ThinkBayes2
examples/world_cup_mcmc.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 classes from thinkbayes2 from thinkbayes2 import Pmf, Cdf, Suite import thinkbayes2 import thin...
fevangelista/wicked
examples/CoupledClusterEquations.ipynb
mit
import wicked as w import time from IPython.display import display, Math, Latex def latex(expr): """Function to render any object that has a member latex() function""" display(Math(expr.latex())) """ Explanation: Automatic generation of coupled cluster equations In this example we use wick&d to generate arbit...
raoyvn/deep-learning
intro-to-rnns/Anna KaRNNa.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160530월_9일차_추정 및 검정 Estimation and Test/3.SciPy를 사용한 기초적인 검정.ipynb
mit
N = 10 theta_0 = 0.5 np.random.seed(0) x = sp.stats.bernoulli(theta_0).rvs(N) n = np.count_nonzero(x) n sp.stats.binom_test(n ,N) """ Explanation: SciPy를 사용한 기초적인 검정 실제로는 t검정을 주로 쓴다. z검정은 잘 안 쓴다. 등분산은 표준편차로 비교하는 건가? SciPy 파이썬 패키지는 다음과 같은 다양한 검정 명령을 제공한다. 이항 검정 (Binomial test) 카이 제곱 검정 (Chi-square test) 단일 표본 z-검정 ...
tclaudioe/Scientific-Computing
SC1/04_roots_of_1D_equations.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt import sympy as sym %matplotlib inline from ipywidgets import interact from ipywidgets import widgets sym.init_printing() from scipy import optimize """ Explanation: <center> <h1> ILI285 - Computación Científica I / INF285 - Computación Científica </h1> <h2> ...
tensorflow/docs-l10n
site/ko/tutorials/distribute/save_and_load.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...
ToqueWillot/M2DAC
FDMS/TME3/Submit_V1.ipynb
gpl-2.0
# from __future__ import exam_success from __future__ import absolute_import from __future__ import print_function %matplotlib inline import sklearn import matplotlib.pyplot as plt import seaborn as sns import numpy as np import random import pandas as pd import scipy.stats as stats # Sk cheats from sklearn.cross_val...
carriegardner428/cybersecurity_datascience
tutorials/Pandas Intro.ipynb
mit
v = pd.Series(np.random.randn(5)) v """ Explanation: Pandas pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language. Pandas Website This tutorial pulls from the Pandas website and the Handson-ML tutorial: https:/...
ctroupin/OceanData_NoteBooks
PythonNotebooks/PlatformPlots/Read_CORA_dataset.ipynb
gpl-3.0
datafile = ( '~/CMEMS_INSTAC/INSITU_GLO_TS_OA_REP_OBSERVATIONS_013_002_b/' 'CORIOLIS-GLOBAL-CORA04.1-OBS_FULL_TIME_SERIE/data/2013/OA_CORA4.1_20131215_dat_PSAL.nc' ) """ Explanation: Salinity from CORA dataset The data can be obtained from Coriolis FTP at ftp://ftp1.ifremer.fr/Core/INSITU_GLO_TS_REP_OBSERVATIO...
ericfourrier/auto-clean
examples/Influence of imputation of missing values on prediction.ipynb
mit
import pandas as pd from autoc import DataExploration, PreProcessor, NaImputer from autoc.utils.getdata import get_dataset import numpy as np # skicit learn from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import cross_val_score,train_test_split from sklearn.ensemble import RandomFore...
DJCordhose/ai
notebooks/workshops/tss/cnn-standard-architectures.ipynb
mit
import warnings warnings.filterwarnings('ignore') %matplotlib inline %pylab inline import matplotlib.pylab as plt import numpy as np from distutils.version import StrictVersion import sklearn print(sklearn.__version__) assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1') import tensorflow as tf t...
omoju/udacityUd120Lessons
SVM.ipynb
gpl-3.0
%pylab inline import sys from time import time sys.path.append("../tools/") from email_preprocess import preprocess from prep_terrain_data import makeTerrainData from class_vis import prettyPicture, output_image import copy """ Explanation: Lesson 2 - Support Vector Machines This is the code to accompany the Less...
KrisCheng/ML-Learning
archive/MOOC/Deeplearning_AI/ImprovingDeepNeuralNetworks/SettingupyourMachineLearningApplication/Regularization.ipynb
mit
# import packages import numpy as np import matplotlib.pyplot as plt from reg_utils import sigmoid, relu, plot_decision_boundary, initialize_parameters, load_2D_dataset, predict_dec from reg_utils import compute_cost, predict, forward_propagation, backward_propagation, update_parameters import sklearn import sklearn.da...
BrownDwarf/ApJdataFrames
notebooks/McClure2010.ipynb
mit
import warnings warnings.filterwarnings("ignore") from astropy.io import ascii import pandas as pd """ Explanation: ApJdataFrames McClure Title: THE EVOLUTIONARY STATE OF THE PRE-MAIN SEQUENCE POPULATION IN OPHIUCHUS: A LARGE INFRARED SPECTROGRAPH SURVEY Authors: McClure et al. Data is from this paper: http://iopsci...
phoebe-project/phoebe2-docs
2.2/tutorials/constraints.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Constraints Setup Let's first make sure we have the latest version of PHOEBE 2.2 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 """ import phoebe from phoebe im...
murrayrm/python-control
examples/stochresp.ipynb
bsd-3-clause
import numpy as np import scipy as sp import matplotlib.pyplot as plt import control as ct from math import sqrt, exp # Fix random number seed to avoid spurious figure regeneration np.random.seed(1) """ Explanation: Stochastic Response Richard M. Murray, 6 Feb 2022 This notebook illustrates the implementation of rand...
pinga-lab/magnetic-ellipsoid
code/lambda_prolate_ellipsoids.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: $\lambda$ variable for prolate ellipsoids End of explanation """ a = 20. b = 13. x = 21. y = 23. z = 30. """ Explanation: Here, we follow the reasoning presented by Webster (1904) for analyzing the ellipsoidal coordinate $\lamb...
vsingla2/Self-Driving-Car-NanoDegree-Udacity
Term1-Computer-Vision-and-Deep-Learning/Project2-Traffic-Sign-Classifier/Traffic_Sign_Classifier.ipynb
mit
# Load pickled data import pickle # TODO: Fill this in based on where you saved the training and testing data training_file = r'C:\Users\VINOD\Google Drive\SDCND\CarND-Traffic-Sign-Classifier-Project\pickled_data\train.p' validation_file = r'C:\Users\VINOD\Google Drive\SDCND\CarND-Traffic-Sign-Classifier-Project\pick...
wcmckee/wcmckee
numbernerd.ipynb
mit
import random import getpass import giphypop #from IPython.display import Image #from IPython.core.display import HTML import webbrowser """ Explanation: Number Nerd Game to test knowledge of numbers. Code based on: http://www.nzqa.govt.nz/assets/qualifications-and-standards/qualifications/ncea/NCEA-subject-resourc...
ES-DOC/esdoc-jupyterhub
notebooks/pcmdi/cmip6/models/sandbox-2/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-2', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: PCMDI Source ID: SANDBOX-2 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Ra...
azhurb/deep-learning
gan_mnist/Intro_to_GANs_Exercises.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...
aakashsinha19/Aspectus
Image Segmentation/tensorflow_notes-master/upsampling_segmentation.ipynb
apache-2.0
from __future__ import division import sys import os import numpy as np from matplotlib import pyplot as plt os.environ["CUDA_VISIBLE_DEVICES"] = '0' sys.path.append("/home/dpakhom1/workspace/models/slim") # A place where you have downloaded a network checkpoint -- look at the previous post checkpoints_dir = '/home/d...