repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
paris-saclay-cds/python-workshop
Day_2_Software_engineering_best_practices/solutions/03_code_style.ipynb
bsd-3-clause
def read_spectra(path_csv): """Read and parse data in pandas DataFrames. Parameters ---------- path_csv : str Path to the CSV file to read. Returns ------- spectra : pandas DataFrame, shape (n_spectra, n_freq_point) DataFrame containing all Raman spectra. ...
vsingla2/Self-Driving-Car-NanoDegree-Udacity
Term1-Computer-Vision-and-Deep-Learning/Project1-Finding-Lane-Lines/P1.ipynb
mit
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline """ Explanation: Self-Driving Car Engineer Nanodegree Project: Finding Lane Lines on the Road In this project, you will use the tools you learned about in the lesson to ide...
drivendata/data-science-is-software
notebooks/lectures/3.0-refactoring.ipynb
mit
%matplotlib inline from __future__ import print_function import os import pandas as pd import matplotlib.pyplot as plt import seaborn as sns PROJ_ROOT = os.path.join(os.pardir, os.pardir) """ Explanation: <table style="width:100%; border: 0px solid black;"> <tr style="width: 100%; border: 0px solid black;"> ...
ituethoslab/navcom-2017
exercises/Week 11-Tooltrack 3/Social media scraping.ipynb
gpl-3.0
biposts = pd.read_csv('page_20446254070_2017_11_14_15_20_00.tab', sep='\t', parse_dates=['post_published']) """ Explanation: Social media scraping 3/3 What have we achieved in the past 2 week? 1. Sanity checks Do them Srsly E.g. a student email 💬 Message from Netvizz Getti...
samoturk/HUB-ipython
notebooks/Intro to Python and Jupyter.ipynb
mit
print('This is cell with code') """ Explanation: Python Python is widely used general-purpose high-level programming language. Its design philosophy emphasizes code readability. It is very popular in science. Jupyter The Jupyter Notebook is a web application that allows you to create and share documents that contain l...
ucsdlib/python-novice-inflammation
5-functions.ipynb
cc0-1.0
import numpy import matplotlib.pyplot def fahr_to_kelvin(temp): return ((temp - 32) * (5/9)) + 273.15 """ Explanation: up to now: * we've written code to draw out some interesting featurs on the inflammation, * looped over our data files to draw plots, * and have python to make decisions based on conditions re...
camillescott/boink
notebooks/decision-nodes-Ast_gla.ipynb
mit
k27_df.hash.nunique(), k35_df.hash.nunique() """ Explanation: We can find the number of decision nodes in the dBG by counting unique hashes... End of explanation """ k35_df['degree'] = k35_df['l_degree'] + k35_df['r_degree'] k27_df['degree'] = k27_df['l_degree'] + k27_df['r_degree'] """ Explanation: We'll make a ne...
afronski/playground-notes
scalable-machine-learning/solutions/ML_lab1_review_student.ipynb
mit
labVersion = 'cs190_week1_v_1_1' """ Explanation: Math and Python review and CTR data download This notebook reviews vector and matrix math, the NumPy Python package, and Python lambda expressions. It also covers downloading the data required for Lab 4, where you will analyze website click-through rates. Part 1 cove...
pybel/pybel-notebooks
summary/Summarizing Multiple Graphs Together.ipynb
apache-2.0
import os import time import sys import pybel import pybel_tools from pybel_tools.summary import info_str """ Explanation: Summarizing Multiple Graphs Together Author: Charles Tapley Hoyt Estimated Run Time: 45 seconds This notebook shows how to combine multiple graphs from different sources and summarize them togeth...
navierula/Subreddit-Analysis-on-Eating-Disorders
Data Preprocessing.ipynb
mit
import pandas as pd json_file = 'sample_data' list(pd.read_json(json_file, lines=True)) """ Explanation: Load a sample of the raw JSON data into pandas. End of explanation """ import csv import json from nltk.tokenize import TweetTokenizer from tqdm import tqdm MIN_NUM_WORD_TOKENS = 10 TOTAL_NUM_LINES = 53851542 #...
zzsza/Datascience_School
30. 딥러닝/01. 신경망 기초 이론.ipynb
mit
%%tikz \tikzstyle{neuron}=[circle, draw, minimum size=23pt,inner sep=0pt] \tikzstyle{bias}=[text centered] \node[neuron] (node) at (2,0) {$z$}; \node[neuron] (x1) at (0, 1) {$x_1$}; \node[neuron] (x2) at (0, 0) {$x_2$}; \node[neuron] (x3) at (0,-1) {$x_3$}; \node[neuron] (b) at (0,-2) {$1$}; \node[neuron] (output) at...
dwhswenson/openpathsampling
examples/alanine_dipeptide_tps/AD_tps_3a_analysis_flex.ipynb
mit
from __future__ import print_function %matplotlib inline import openpathsampling as paths import numpy as np import matplotlib.pyplot as plt import os import openpathsampling.visualize as ops_vis from IPython.display import SVG """ Explanation: Analyzing the flexible path length simulation End of explanation """ # n...
UPML/complexityTheory
toGit/TSP/tsp/results.ipynb
apache-2.0
class Node: def __init__(self, number, cost, time, answer): self.number = int(number) self.cost = float(cost) self.time = float(time) / 10**9 self.size = self.number / 100 self.answer = answer def write(self): print("n = ", self.number," \n") print("cost ...
manolomartinez/skyrms
Signal Tutorial.ipynb
gpl-3.0
sender = np.identity(3) receiver = np.identity(3) state_chances = np.array([1/3, 1/3, 1/3]) """ Explanation: 1. Setting things up Let's take a look at game.py, which we use to create games. Right now, Signal only does cheap-talk games with a chance player. That is, games in which the state the sender observes is exoge...
rmdort/clipper
examples/tutorial/tutorial_part_one.ipynb
apache-2.0
cifar_loc = "" %run ./download_cifar.py $cifar_loc """ Explanation: Clipper Tutorial: Part 1 This tutorial will walk you through the process of starting Clipper, creating and querying a Clipper application, and deploying models to Clipper. In the first part of the demo, you will set up Clipper and create an applicatio...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/building_production_ml_systems/solutions/0_export_data_from_bq_to_gcs.ipynb
apache-2.0
#%load_ext google.cloud.bigquery import os from google.cloud import bigquery """ Explanation: Exporting data from BigQuery to Google Cloud Storage In this notebook, we export BigQuery data to GCS so that we can reuse our Keras model that was developed on CSV data. Uncomment the following line if you are running the ...
Neuroglycerin/neukrill-net-work
notebooks/model_run_and_result_analyses/Analyse Extra MLP Layers with Dropout.ipynb
mit
import pylearn2.utils import pylearn2.config import theano import neukrill_net.dense_dataset import neukrill_net.utils import numpy as np %matplotlib inline import matplotlib.pyplot as plt import holoviews as hl %load_ext holoviews.ipython import sklearn.metrics """ Explanation: Started some more runs with extra MLP l...
n-witt/MachineLearningWithText_SS2017
exercises/solutions/0 Python basics exercises.ipynb
gpl-3.0
def maximum(x, y): if x > y: return x else: return y assert maximum(3, 3) == 3 assert maximum(1, 2) == 2 assert maximum(3, 2) == 3 """ Explanation: 1. Define a function maximum that takes two numbers as arguments and returns the largest of them. Use the if-then-else construct available in Pyth...
erdewit/ib_insync
notebooks/tick_data.ipynb
bsd-2-clause
from ib_insync import * util.startLoop() ib = IB() ib.connect('127.0.0.1', 7497, clientId=15) """ Explanation: Tick data For optimum results this notebook should be run during the Forex trading session. End of explanation """ contracts = [Forex(pair) for pair in ('EURUSD', 'USDJPY', 'GBPUSD', 'USDCHF', 'USDCAD', 'A...
letsgoexploring/teaching
winter2017/econ129/python/Econ129_Class_05.ipynb
mit
# Use the requests module to download money growth and inflation data url = 'http://www.briancjenkins.com/data/quantitytheory/csv/qtyTheoryData.csv' r = requests.get(url,verify=True) with open('qtyTheoryData.csv','wb') as newFile: newFile.write(r.content) """ Explanation: Class 5: Pandas Pandas is a Python p...
mayankjohri/LetsExplorePython
Section 3 - Machine Learning/Supervised Learning Algorithm/Regression Analysis/3. Ridge Regression.ipynb
gpl-3.0
import numpy as np import pandas as pd import random import matplotlib.pyplot as plt %matplotlib inline from matplotlib.pylab import rcParams rcParams['figure.figsize'] = 12, 10 #Define input array with angles from 60deg to 300deg converted to radians x = np.array([i*np.pi/180 for i in range(60,300,4)]) np.random.seed...
fweik/espresso
doc/tutorials/ferrofluid/ferrofluid_part3.ipynb
gpl-3.0
import espressomd espressomd.assert_features('DIPOLES', 'LENNARD_JONES') from espressomd.magnetostatics import DipolarP3M import numpy as np """ Explanation: Ferrofluid - Part 3 Table of Contents Susceptibility with fluctuation formulas Derivation of the fluctuation formula Simulation Magnetization curve of a 3D s...
mromanello/SunoikisisDC_NER
participants_notebooks/Sunoikisis - Named Entity Extraction 1b-GB.ipynb
gpl-3.0
######## # NLTK # ######## import nltk from nltk.tag import StanfordNERTagger ######## # CLTK # ######## import cltk from cltk.tag.ner import tag_ner ############## # MyCapytain # ############## import MyCapytain from MyCapytain.resolvers.cts.api import HttpCTSResolver from MyCapytain.retrievers.cts5 import CTS from M...
informatics-isi-edu/deriva-py
docs/derivapy-datapath-example-3.ipynb
apache-2.0
# Import deriva modules from deriva.core import ErmrestCatalog, get_credential # Connect with the deriva catalog protocol = 'https' hostname = 'www.facebase.org' catalog_number = 1 # If you need to authenticate, use Deriva Auth agent and get the credential credential = get_credential(hostname) catalog = ErmrestCatalog...
muratcemkose/cy-rest-python
advanced/integratingDrugbank.ipynb
mit
import requests import json import pandas as pd PORT_NUMBER = 1234 BASE = 'http://localhost:' + str(PORT_NUMBER) + '/v1/' HEADERS = {'Content-Type': 'application/json'} requests.post(BASE + 'networks?source=url&collection=KEGG', data=json.dumps(['http://rest.kegg.jp/get/eco00250/kgml']), headers=HEADERS) """ Explana...
karlstroetmann/Formal-Languages
Python/Regexp-Tutorial.ipynb
gpl-2.0
import re """ Explanation: Regular Expressions in Python (A Short Tutorial) This is a tutorial showing how regular expressions are supported in Python. The assumption is that the reader already has a grasp of the concept of regular expressions as it is taught in lectures on formal languages, for example in Formal L...
simpeg/simpegmt
notebooks/Derivative test MT1D.ipynb
mit
import SimPEG as simpeg import simpegEM as simpegem, simpegMT as simpegmt from SimPEG.Utils import meshTensor import numpy as np simpegmt.FieldsMT.FieldsMT_1D # Setup the problem sigmaHalf = 1e-2 # Frequency nFreq = 33 # freqs = np.logspace(3,-3,nFreq) freqs = np.array([100]) # Make the mesh ct = 5 air = meshTensor([...
aschaffn/phys202-2015-work
assignments/assignment03/NumpyEx01.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import antipackage import github.ellisonbg.misc.vizarray as va """ Explanation: Numpy Exercise 1 Imports End of explanation """ # there's got to be a more efficient way using some sort # of list comprehension def checkerbo...
spencer2211/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...
phoebe-project/phoebe2-docs
2.2/tutorials/ETV.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" """ Explanation: ETV 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 inl...
teuben/astr288p
notebooks/05-images.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np # import pyfits as fits # deprecated from astropy.io import fits """ Explanation: Images: rows, columns and all that jazzy mess.... Two dimensional data arrays are normally stored in column-major or row-major order. In row-ma...
tuanavu/coursera-university-of-washington
machine_learning/4_clustering_and_retrieval/assigment/week6/.ipynb_checkpoints/6_hierarchical_clustering_graphlab-checkpoint.ipynb
mit
import graphlab import matplotlib.pyplot as plt import numpy as np import sys import os import time from scipy.sparse import csr_matrix from sklearn.cluster import KMeans from sklearn.metrics import pairwise_distances %matplotlib inline '''Check GraphLab Create version''' from distutils.version import StrictVersion as...
ryan-leung/PHYS4650_Python_Tutorial
notebooks/02-Python-Data-Structures.ipynb
bsd-3-clause
a = 1 # integer b = 1.1 #floating point numbers c = True; d = False # Boolean (logical expression) e = "Hello" # Strings """ Explanation: Python Data Structures Data structure in computing Data structures are how computer programs store information. Theses information can be processed, analyzed and visualized easily ...
mathemage/h2o-3
examples/deeplearning/notebooks/deeplearning_image_reconstruction_and_clustering.ipynb
apache-2.0
%matplotlib inline import matplotlib import numpy as np import pandas as pd import scipy.io import matplotlib.pyplot as plt from IPython.display import Image, display import h2o from h2o.estimators.deeplearning import H2OAutoEncoderEstimator h2o.init() """ Explanation: Image Space Projection using Autoencoders In t...
minesh1291/Practicing-Kaggle
MNIST_2017/dump_/men_2018_0ld_logistic_script.ipynb
gpl-3.0
#the seed information #df_seeds = pd.read_csv('../input/NCAATourneySeeds.csv') #print(df_seeds.shape) #print(df_seeds.head()) #print(df_seeds.Season.value_counts()) #the seed information df_seeds = pd.read_csv('../input/NCAATourneySeeds_SampleTourney2018.csv') print(df_seeds.shape) print(df_seeds.head()) #print(df_see...
guyhoffman/hri-statistics
notebooks/Binary_HMM_Filtering.ipynb
mit
import numpy as np from matplotlib import pyplot as plt class BinaryHMM: """ startprob: np.array(shape(2,)) transmat: np.array(shape(2,2)) - First column is P(X|x), second is P(X|~x) emissionprob: np.array(shape(2,2)) - First column is P(E|x), second is P(E|~x) """ def __init__(self, startprob,...
phobson/statsmodels
examples/notebooks/tsa_dates.ipynb
bsd-3-clause
from __future__ import print_function import statsmodels.api as sm import numpy as np import pandas as pd """ Explanation: Dates in timeseries models End of explanation """ data = sm.datasets.sunspots.load() """ Explanation: Getting started End of explanation """ from datetime import datetime dates = sm.tsa.datet...
BjornFJohansson/pydna-examples
notebooks/strawberry_aat/strawberry.ipynb
bsd-3-clause
# Import the pydna package functions from pydna.all import * # Give your email address to Genbank, so they can contact you. # This is a requirement for using their services gb=Genbank("bjornjobb@gmail.com") # download the SAAT CDS from Genbank # We know from inspecting the saat = gb.nucleotide("AF193791 REGION: 78..1...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/27_seq2seq/notebooks/seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
telecombcn-dl/2017-cfis
sessions/convnets.ipynb
mit
import matplotlib.pyplot as plt %matplotlib inline from utils import plot_samples, plot_curves import time import numpy as np # force random seed for results to be reproducible SEED = 4242 np.random.seed(SEED) """ Explanation: Convolutional Neural Networks So far we have been treating images as flattened arrays of ...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_channel_epochs_image.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io from mne.datasets import sample print(__doc__) data_path = sample.data_path() """ Explanation: Visualize channel over epochs as an ima...
whitead/numerical_stats
unit_12/hw_2017/problem_set_1.ipynb
gpl-3.0
import scipy.stats as ss ss.shapiro([-26.3,-24.2, -20.9, -25.8, -24.3, -22.6, -23.0, -26.8, -26.5, -23.1, -20.0, -23.1, -22.4, -22.8]) """ Explanation: Problem 1 Instructions Answer the following short-answer questions using Markdown cells Problem 1.1 A $t$-test and $zM$ test rely on the assumption of normality. How ...
GoogleCloudPlatform/training-data-analyst
courses/ai-for-finance/solution/aapl_regression_scikit_learn.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst !pip install --user google-cloud-bigquery==1.25.0 """ Explanation: Building a Regression Model for a Financial Dataset In this notebook, you will build a simple linear regression model to predict the closing AAPL stock price. The lab objectives are: *...
mne-tools/mne-tools.github.io
0.19/_downloads/162648d33d7b9ea4f5ce1e8bb494a02d/plot_mne_inverse_label_connectivity.ipynb
bsd-3-clause
# Authors: Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Nicolas P. Rougier (graph code borrowed from his matplotlib gallery) # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import sample f...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/noresm2-lm/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lm', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: NCC Source ID: NORESM2-LM Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbul...
phuongxuanpham/SelfDrivingCar
CarND-Behavioral-Cloning-Project3/model.ipynb
gpl-3.0
import os import csv import cv2 import numpy as np import sklearn """ Explanation: Behavioral Cloning This is the Project 3 in Self Driving Car Nano degree from Udacity The purpose of this project is using deep learning to train a deep neural network to drive a car automously in a simulator. Behavioral Cloning Projec...
ES-DOC/esdoc-jupyterhub
notebooks/mpi-m/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', 'mpi-m', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: MPI-M Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turb...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_compute_mne_inverse.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt from mne.datasets import sample from mne import read_evokeds from mne.minimum_norm import apply_inverse, read_inverse_operator print(__doc__) data_path = sample.data_path() fname_inv = d...
ddtm/dl-course
Seminar9/Seminar9_ru.ipynb
mit
low_RAM_mode = True very_low_RAM = False #если у вас меньше 3GB оперативки, включите оба флага import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Использование глубокого обучения в NLP Смотрите в этой серии: * Простые способы работать с текстом, bag of words ...
dipanjank/ml
data_analysis/computer_hardware_uci.ipynb
gpl-3.0
import numpy as np import pandas as pd %pylab inline pylab.style.use('ggplot') import seaborn as sns url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/cpu-performance/machine.data' data = pd.read_csv(url, header=None) data.head() """ Explanation: Computer Hardware Dataset Analysis - UCI This is a regr...
ercanezin/ce888labs
lab3/facebook_regression.ipynb
gpl-3.0
df = pd.read_csv("./dataset_Facebook.csv", delimiter = ";") features = ["Category", "Page total likes", "Type", "Post Month", "Post Hour", "Post Weekday", "Paid"] df[features].head() outcomes= ["Lifetime Post Total Reach", "Lifeti...
rajul/tvb-library
tvb/simulator/demos/region_deterministic_larterbreakspear.ipynb
gpl-2.0
# Third party python libraries import numpy # Try and import from "The Virtual Brain" from tvb.simulator.lab import * from tvb.datatypes.time_series import TimeSeriesRegion import tvb.analyzers.fmri_balloon as bold from tvb.simulator.plot import timeseries_interactive as timeseries_interactive """ Explanation: Explor...
facaiy/book_notes
machine_learning/tree/decision_tree/demo.ipynb
cc0-1.0
from sklearn.datasets import load_iris data = load_iris() # 准备特征数据 X = pd.DataFrame(data.data, columns=["sepal_length", "sepal_width", "petal_length", "petal_width"]) X.head(2) # 准备标签数据 y = pd.DataFrame(data.target, columns=['target']) y.replace(to_replace=range(3), value=data.target_names, inplace=...
statsmodels/statsmodels.github.io
v0.13.2/examples/notebooks/generated/exponential_smoothing.ipynb
bsd-3-clause
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt %matplotlib inline data = [ 446.6565, 454.4733, 455.663, 423.6322, 456.2713, 440.5881, 425.3325, 485.1494, 506.0482, 5...
wd15/chimad-phase-field
hackathons/hackathon1/fipy/1c.ipynb
mit
%matplotlib inline import sympy import fipy as fp import numpy as np A, c, c_m, B, c_alpha, c_beta = sympy.symbols("A c_var c_m B c_alpha c_beta") f_0 = - A / 2 * (c - c_m)**2 + B / 4 * (c - c_m)**4 + c_alpha / 4 * (c - c_alpha)**4 + c_beta / 4 * (c - c_beta)**4 print f_0 sympy.diff(f_0, c, 2) """ Explanation: Ta...
sourabhrohilla/ds-masterclass-hands-on
session-2/python/TopicModel.ipynb
mit
PATH_NEWS_ARTICLES = "" from nltk.corpus import stopwords from nltk.tokenize import TweetTokenizer from nltk.stem.snowball import SnowballStemmer import re import pickle import pandas as pd import gensim from gensim import corpora, models """ Explanation: Topic Modeling using LDA Topic Modeling Using LDA Text Proces...
dtamayo/rebound
ipython_examples/RemovingParticlesFromSimulation.ipynb
gpl-3.0
import rebound import numpy as np sim = rebound.Simulation() sim.add(m=1., hash=0) for i in range(1,10): sim.add(a=i, hash=i) sim.move_to_com() print("Particle hashes:{0}".format([sim.particles[i].hash for i in range(sim.N)])) """ Explanation: Removing particles from the simulation This tutorial shows the differ...
mne-tools/mne-tools.github.io
0.18/_downloads/8e91c4d84fe688d78859cf6274554a8b/plot_compute_csd.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # License: BSD (3-clause) from matplotlib import pyplot as plt import mne from mne.datasets import sample from mne.time_frequency import csd_fourier, csd_multitaper, csd_morlet print(__doc__) """ Explanation: ================================================== Compu...
zzsza/Datascience_School
06. 기초 선형대수/04. NumPy를 활용한 선형대수 입문.ipynb
mit
x = np.array([1, 2, 3, 4]) x x = np.array([[1], [2], [3], [4]]) x """ Explanation: NumPy를 활용한 선형대수 입문 선형대수(linear algebra)는 데이터 분석에 필요한 각종 계산을 위한 기본적인 학문이다. 데이터 분석을 하기 위해서는 실제로 수많은 숫자의 계산이 필요하다. 하나의 데이터 레코드(record)가 수십개에서 수천개의 숫자로 이루어져 있을 수도 있고 수십개에서 수백만개의 이러한 데이터 레코드를 조합하여 계산하는 과정이 필요할 수 있다. 선형대수를 사용하는 첫번째 장점은 이러...
tensorflow/docs-l10n
site/ko/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...
AshleySetter/optoanalysis
Damping_radius_relation.ipynb
mit
# constants k_B = Boltzmann eta_air = 18.27e-6 # Pa # (J.T.R.Watson (1995)). d_gas = 0.372e-9 #m #(Sone (2007)), ρSiO2 rho_SiO2 = 1800 # #kg/m^3 - Number told to us by T0 = 300 R = 50e-9 # m def mfp(P_gas): mfp_val = k_B*T0/(2**0.5*pi*d_gas**2*P_gas) return mfp_val """ Explanation: Relation 1 The form of t...
beangoben/HistoriaDatos_Higgs
Dia1/.ipynb_checkpoints/3_Intro a Matplotlib-checkpoint.ipynb
gpl-2.0
import numpy as np # modulo de computo numerico import matplotlib.pyplot as plt # modulo de graficas import pandas as pd # modulo de datos # esta linea hace que las graficas salgan en el notebook %matplotlib inline """ Explanation: Intro a Matplotlib Matplotlib = Libreria para graficas cosas matematicas Que es Matplot...
jinzishuai/learn2deeplearn
deeplearning.ai/C5.SequenceModel/Week1_RNN/assignment/Dinosaur Island -- Character-level language model/Dinosaurus Island -- Character level language model final - v2-Copy1.ipynb
gpl-3.0
import numpy as np from utils import * import random from random import shuffle """ Explanation: Character level language model - Dinosaurus land Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers...
planetlabs/notebooks
jupyter-notebooks/in-class-exercises/band-math-generate-ndvi/generate-ndvi-exercise-key.ipynb
apache-2.0
# To use Planet's CLI from this Notebook, begin your line as follows: !planet data # Here is an example of using Planet's CLI to search for a known item id: # !planet data download --item-type PSScene --asset-type ortho_analytic_4b_sr --dest data --string-in id 20160831_180302_0e26 """ Explanation: Deriving a vegetat...
awsteiner/o2sclpy
doc/static/examples/table.ipynb
gpl-3.0
import o2sclpy import matplotlib.pyplot as plot import sys plots=True if 'pytest' in sys.modules: plots=False """ Explanation: O$_2$scl table example for O$_2$sclpy See the O$_2$sclpy documentation at https://neutronstars.utk.edu/code/o2sclpy for more information. End of explanation """ link=o2sclpy.linker() li...
aaossa/Dear-Notebooks
More/FacebookGraphAPI_ES.ipynb
gpl-3.0
import json import requests BASE = "https://graph.facebook.com" VERSION = "v2.5" # Si queremos imprimir los json de respuesta # de una forma mas agradable a la vista podemos usar def print_pretty(jsonstring, indent=4, sort_keys=False): print(json.dumps(jsonstring, indent=indent, sort_keys=sort_keys)) """ Explan...
GoogleCloudPlatform/asl-ml-immersion
notebooks/kubeflow_pipelines/pipelines/labs/kfp_pipeline.ipynb
apache-2.0
# Set `PATH` to include the directory containing TFX CLI and skaffold. PATH = %env PATH %env PATH=/home/jupyter/.local/bin:{PATH} """ Explanation: Continuous training pipeline with KFP and Cloud AI Platform Learning Objectives: 1. Learn how to use KF pre-build components (BiqQuery, CAIP training and predictions) 1. Le...
mayank-johri/LearnSeleniumUsingPython
Section 1 - Core Python/Chapter 05 - Data Types/String.ipynb
gpl-3.0
#### Standard String Examples: friend = 'Chandu\tNalluri' print(friend) manager_details = "# Roshan Musheer:\nExcellent Manager and human being." print(manager_details) """ Explanation: String Strings are Python builtins datatype for handling text. They are immutable thus you can not add, remove or updated any char...
pbeens/ICS-Computer-Studies
Python/Class Demos/Demo Notebook (work in progress).ipynb
mit
import numpy as np nums1 = np.random.randint(1,11, 15) nums1 """ Explanation: Class Python Demos I will be using this Notebook for class demos. To use at home, load Anaconda (https://www.continuum.io/downloads) or WinPython (https://winpython.github.io/) Set() demo First let's create a random list using the numpy libr...
Danghor/Algorithms
Python/Chapter-06/Ordered-Binary-Tree.ipynb
gpl-2.0
class OrderedBinaryTree: def __init__(self): self.mKey = None self.mValue = None self.mLeft = None self.mRight = None """ Explanation: Ordered Binary Trees This notebook implements ordered binary trees. In order to define this notion, we first have to define the concept of orde...
NYUDataBootcamp/Projects
UG_S16/Acosta-NHL-GRIT.ipynb
mit
import pandas as pd #PandasPandas %matplotlib inline import matplotlib.pyplot as plt import numpy as np print('PandaPandaPanda ', pd.__version__) df=pd.read_csv('NHLQUANT.csv') """ Explanation: Data BootCamp Project End of explanation """ plt.plot(df.index,df['Grit']) """ Explanation: Who has Grit? Hockey has alway...
scheema/Machine-Learning
Datascience_Lab0.ipynb
mit
import numpy as np from io import BytesIO import matplotlib import matplotlib.pyplot as plt import random from mpl_toolkits.mplot3d import Axes3D from bs4 import BeautifulSoup import urllib.request %matplotlib inline """ Explanation: Solution Implementation by Srinivas Cheemalapati CS 109A/AC 209A/STAT 121A Data Sc...
zizouvb/deeplearning
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...
Autodesk/molecular-design-toolkit
moldesign/_notebooks/Tutorial 3. Quantum Chemistry.ipynb
apache-2.0
%matplotlib inline import numpy as np from matplotlib.pylab import * try: import seaborn #optional, makes plots look nicer except ImportError: pass import moldesign as mdt from moldesign import units as u """ Explanation: <span style="float:right"><a href="http://moldesign.bionano.autodesk.com/" target="_blank" titl...
pysal/pysal
notebooks/explore/pointpats/distance_statistics.ipynb
bsd-3-clause
import scipy.spatial import pysal.lib as ps import numpy as np from pysal.explore.pointpats import PointPattern, PoissonPointProcess, as_window, G, F, J, K, L, Genv, Fenv, Jenv, Kenv, Lenv %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Distance Based Statistical Method for Planar Point Patterns Au...
tclaudioe/Scientific-Computing
SC1/Bonus_Newton_Rn.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from ipywidgets import interact """ Explanation: <center> <h1> ILI285 - Computación Científica I / INF285 - Computación Científica </h1> <h2> Newton's Method in $\mathbb{R}^n$ </h2> <h2> <a href="#acknowledgements"> [S]cientific [C]ompu...
tensorflow/docs-l10n
site/en-snapshot/probability/examples/Eight_Schools.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
zzsza/Datascience_School
09. 기초 확률론2 - 확률 변수/05. 누적 분포 함수와 확률 밀도 함수.ipynb
mit
%%tikz \filldraw [fill=white] (0,0) circle [radius=1cm]; \foreach \angle in {60,30,...,-270} { \draw[line width=1pt] (\angle:0.9cm) -- (\angle:1cm); } \draw (0,0) -- (90:0.8cm); """ Explanation: 누적 분포 함수와 확률 밀도 함수 누적 분포 함수(cumulative distribution function)와 확률 밀도 함수(probability density function)는 확률 변수의 분포 즉, 확률 분포를...
Pybonacci/notebooks
tutormagic.ipynb
bsd-2-clause
%load_ext tutormagic """ Explanation: Esta será una microentrada para presentar una extensión para el notebook que estoy usando en un curso interno que estoy dando en mi empresa. Si a alguno más os puede valer para mostrar cosas básicas de Python (2 y 3, además de Java y Javascript) para muy principiantes me alegro. N...
phoebe-project/phoebe2-docs
2.0/tutorials/backend.ipynb
gpl-3.0
%matplotlib inline import phoebe from phoebe import u # units import numpy as np import matplotlib.pyplot as plt logger = phoebe.logger() b = phoebe.default_binary() b['q'] = 0.8 b['ecc'] = 0.05 """ Explanation: IPython Notebook | Python Script Advanced: Digging into the Backend Setup As always, let's do imports a...
borja876/Thinkful-DataScience-Borja
Housing Prices.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import scipy import sklearn import matplotlib.pyplot as plt import seaborn as sns import math from sklearn.preprocessing import StandardScaler from sklearn.metrics import confusion_matrix, accuracy_score, mean_squared_error from sklearn.model_selection import tr...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_source_alignment.ipynb
bsd-3-clause
import os.path as op import numpy as np from mayavi import mlab import mne from mne.datasets import sample print(__doc__) data_path = sample.data_path() subjects_dir = op.join(data_path, 'subjects') raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif') trans_fname = op.join(data_path, 'MEG', 'sam...
tuwien-musicir/rp_extract
RP_extract_Tutorial.ipynb
gpl-3.0
# to install iPython notebook on your computer, use this in Terminal sudo pip install "ipython[notebook]" """ Explanation: <center><h1>Rhythm and Timbre Analysis from Music</h1></center> <center><h2>Rhythm Pattern Music Features</h2></center> <center><h2>Extraction and Application Tutorial</h2></center> <br> <center><...
AllenDowney/ProbablyOverthinkingIt
generations.ipynb
mit
from __future__ import print_function, division from thinkstats2 import Pmf, Cdf import thinkstats2 import thinkplot import pandas as pd import numpy as np from scipy.stats import entropy %matplotlib inline """ Explanation: Do generations exist? This notebook contains a "one-day paper", my attempt to pose a resear...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/wls.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import statsmodels.api as sm from scipy import stats from statsmodels.iolib.table import SimpleTable, default_txt_fmt np.random.seed(1024) """ Explanation: Weighted Least Squares End of explanation """ nsample = 50 x = np.linspace(0, 20, nsample...
GoogleCloudPlatform/asl-ml-immersion
notebooks/tfx_pipelines/walkthrough/solutions/tfx_walkthrough.ipynb
apache-2.0
import os import tempfile import time from pprint import pprint import absl import tensorflow as tf import tensorflow_data_validation as tfdv import tensorflow_model_analysis as tfma import tensorflow_transform as tft import tfx from tensorflow_metadata.proto.v0 import ( anomalies_pb2, schema_pb2, statisti...
Neuroglycerin/neukrill-net-work
notebooks/troubleshooting_and_sysadmin/Brute force venv comparison.ipynb
mit
cd ../.. """ Explanation: In the last notebook compared pip freeze output and installed packages so that it matched. Did not find error. Must be some other difference in the virtualenv. So, going to use rsync to compare everything in both venvs. End of explanation """ !rsync -nrvl --ignore-times --size-only --exclud...
JamesSample/enviro_mod_notes
notebooks/odes.ipynb
mit
alpha = 0.75 # Download Tarland data data_url = r'https://drive.google.com/uc?export=&id=0BximeC_RweaecHNIZF9GMHkwaWc' met_df = pd.read_csv(data_url, parse_dates=True, dayfirst=True, index_col=0) del met_df['Q_Cumecs'] # Linear interpolation of any missing values met_df.interpolate(method='linear', inplace=True) # ...
quoniammm/mine-tensorflow-examples
dpAI/Logistic+Regression+with+a+Neural+Network+mindset+v3.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import h5py import scipy from PIL import Image from scipy import ndimage from lr_utils import load_dataset %matplotlib inline """ Explanation: Logistic Regression with a Neural Network mindset Welcome to your first (required) programming assignment! You will build a ...
liyigerry/msm_test
mdtraj_clustering.ipynb
apache-2.0
from __future__ import print_function %matplotlib inline import mdtraj as md import numpy as np import matplotlib.pyplot as plt import scipy.cluster.hierarchy """ Explanation: In this example, we cluster our alanine dipeptide trajectory using the RMSD distance metric and Ward's method. End of explanation """ traj = ...
AndreySheka/dl_ekb
hw10/Bonus-handcrafted-rnn.ipynb
mit
start_token = " " with open("names") as f: names = f.read()[:-1].split('\n') names = [start_token+name for name in names] print 'n samples = ',len(names) for x in names[::1000]: print x """ Explanation: Generate names Struggle to find a name for the variable? Let's see how you'll come up with a nam...
samuelshaner/openmc
docs/source/pythonapi/examples/mdgxs-part-ii.ipynb
mit
import math import pickle from IPython.display import Image import matplotlib.pyplot as plt import numpy as np import openmc import openmc.mgxs import openmoc import openmoc.process from openmoc.opencg_compatible import get_openmoc_geometry from openmoc.materialize import load_openmc_mgxs_lib %matplotlib inline """...
ronnydw/data-science-projects
class-central-survey-2016-17/Class Central Survey - Latin America vs Rest of the World.ipynb
mit
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set(style="white") sns.set_context("talk") """ Explanation: Class Central Survey: compare target group 'Latin America' with the rest of the sample End of explanation """ df = pd.read_csv('raw/2016-17-ClassCentral-Survey-data-noUserText.csv...
ES-DOC/esdoc-jupyterhub
notebooks/mri/cmip6/models/mri-agcm3-2/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mri', 'mri-agcm3-2', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: MRI Source ID: MRI-AGCM3-2 Topic: Aerosol Sub-Topics: Transport, Emissions, Con...
NlGG/Projects
不動産/research02.ipynb
mit
print(data['CITY_NAME'].value_counts()) """ Explanation: 変数名とデータの内容メモ CENSUS: 市区町村コード(9桁) P: 成約価格 S: 専有面積 L: 土地面積 R: 部屋数 RW: 前面道路幅員 CY: 建築年 A: 建築後年数(成約時) TS: 最寄駅までの距離 TT: 東京駅までの時間 ACC: ターミナル駅までの時間 WOOD: 木造ダミー SOUTH: 南向きダミー RSD: 住居系地域ダミー CMD: 商...
Almaz-KG/MachineLearning
ml-for-finance/python-for-financial-analysis-and-algorithmic-trading/02-NumPy/Numpy Exercise - Solutions.ipynb
apache-2.0
import numpy as np """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> <center>Copyright Pierian Data 2017</center> <center>For more information, visit us at www.pieriandata.com</center> NumPy Exercises - Solutions Now that we've learned about NumPy let's test your knowle...
YAtOff/python0-reloaded
week2/Expressions, variables and errors.ipynb
mit
2 * 3 + 2 2 * (3 + 2) """ Explanation: Изрази Изразите в Python са като изразите в математиката. Всеки изразе е изграден от сотйности (като напр. числата 1, 2, 3, ...) и оператори (+, -, ...). Типове Всяка стойност се характеризира с определн тип. А типът е: - Множеството от стойности - Множество от операции, които м...
qaisermazhar/qaisermazhar.github.io
markdown_generator/publications.ipynb
mit
!cat publications.tsv """ Explanation: Publications markdown generator for academicpages Takes a TSV of publications with metadata and converts them for use with academicpages.github.io. This is an interactive Jupyter notebook (see more info here). The core python code is also in publications.py. Run either from the m...
NagyAttila/Udacity_DLND_Assigments
3_tv-script-generation/dlnd_tv_script_generation.ipynb
gpl-3.0
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
jovanbrakus/data-analysis-tools
week-2-assignment.ipynb
gpl-3.0
import pandas import numpy import scipy.stats import seaborn import matplotlib.pyplot as plt data = pandas.read_csv('nesarc_pds.csv', low_memory=False) # MAJORDEPLIFE - Diagnosed major depressions in lifetime # S2AQ5A - Drink beer in last 12 months # S2AQ5B - How often drank a beer in last year data['MAJORDEPLIFE'] ...