repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
bwgref/nustar_pysolar
notebooks/20170911/Planning_20170911.ipynb
mit
fname = io.download_occultation_times(outdir='../data/') print(fname) """ Explanation: Download the list of occultation periods from the MOC at Berkeley. Note that the occultation periods typically only are stored at Berkeley for the future and not for the past. So this is only really useful for observation planning. ...
girving/tensorflow
tensorflow/contrib/eager/python/examples/workshop/2_models.ipynb
apache-2.0
import tensorflow as tf tf.enable_eager_execution() tfe = tf.contrib.eager """ Explanation: View in Colaboratory End of explanation """ # Creating variables v = tf.Variable(1.0) v v.assign_add(1.0) v """ Explanation: Variables TensorFlow variables are useful to store the state in your program. They are integrated ...
murali-munna/pattern_classification
data_collecting/reading_mnist.ipynb
gpl-3.0
import os import struct import numpy as np def load_mnist(path, which='train'): if which == 'train': labels_path = os.path.join(path, 'train-labels-idx1-ubyte') images_path = os.path.join(path, 'train-images-idx3-ubyte') elif which == 'test': labels_path = os.path.join(path, 't10k-la...
gouthambs/karuth-source
content/extra/notebooks/moment_matching.ipynb
artistic-2.0
import QuantLib as ql import numpy as np import matplotlib.pyplot as plt %matplotlib inline from scipy.integrate import cumtrapz ql.__version__ """ Explanation: Variance Reduction in Hull-White Monte Carlo Simulation Using Moment Matching Goutham Balaraman In an earlier blog post on how the Hull-White Monte Carlo simu...
hposborn/Namaste
Example.ipynb
mit
from namaste import * import numpy as np import matplotlib.pyplot as plt %matplotlib inline #%matplotlib inline %reload_ext autoreload %autoreload 2 """ Explanation: Namaste 2 example Here is a short readable (and copy-and-pastable) example as to how to use Namaste 2 to fit a single transit. End of explanation """ ...
scoaste/showcase
machine-learning/regression/week-2-multiple-regression-assignment-1-complete.ipynb
mit
import graphlab """ Explanation: Regression Week 2: Multiple Regression (Interpretation) The goal of this first notebook is to explore multiple regression and feature engineering with existing graphlab functions. In this notebook you will use data on house sales in King County to predict prices using multiple regressi...
ysasaki6023/NeuralNetworkStudy
examples/exploitation vs exploration.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from bayes_opt import BayesianOptimization # use sklearn's default parameters for theta and random_start gp_params = {"corr": "cubic", "theta0": 0.1, "thetaL": None, "thetaU": None, "random_start": 1} """ Explanation: Exploitation vs Exploration ...
mayankjohri/LetsExplorePython
Section 2 - Advance Python/Chapter S2.01 - Functional Programming/02_02_map_reduce_and_filter.ipynb
gpl-3.0
names = [ "Manish", "Aalok", "Mayank","Durga"] lst = [] for name in names: lst.append(len(name)) print(lst) names = ("Manish", "Aalok", "Mayank","Durga") tmp = map(len, names) print(tmp) lst = tuple(tmp) print(lst) # This is a map that squares every number in the passed collection: power = map(lambda x: ...
eweill/DeepROAD
Samples/TensorFlow/MNISTForMLBeginners.ipynb
mit
!sudo unlink /usr/local/cuda !sudo ln -s /usr/local/cuda-7.5 /usr/local/cuda """ Explanation: MNIST For ML Beginners End of explanation """ from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) """ Explanation: This tutorial is intended for readers...
miaecle/deepchem
examples/tutorials/09_Creating_a_high_fidelity_model_from_experimental_data.ipynb
mit
%tensorflow_version 1.x !curl -Lo deepchem_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py import deepchem_installer %time deepchem_installer.install(version='2.3.0') """ Explanation: Tutorial Part 9: Creating a high fidelity dataset from experimental data Suppose you w...
sthuggins/phys202-2015-work
assignments/assignment05/InteractEx01.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 01 Import End of explanation """ def print_sum(a, b): return a+b """ Explanation: Interact basics Write ...
stubz/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...
ghvn7777/ghvn7777.github.io
content/fluent_python/9_python_object.ipynb
apache-2.0
v1 = Vector2d(3, 4) print(v1.x, v1.y) # 可以直接通过属性访问 x, y = v1 # 可以拆包成元祖 x, y v1 v1_clone = eval(repr(v1)) # repr 函数调用 Vector2d 实例,结果类似于构建实例的源码 v1 == v1_clone # 支持 == 比较 print(v1) # 会调用 str 函数,对 Vector2d 来说,输出的是一个有序对 octets = bytes(v1) # 调用 __bytes__ 方法,生成实例的二进制表示形式 octets abs(v1) # 会调用 __abs__ 方法,返回 Vector2d 实例的模 ...
clauwag/WikipediaGenderInequality
notebooks/Lexical Analysis - 02 PMI of Common Vocabulary.ipynb
mit
from __future__ import print_function, unicode_literals, division from cytoolz.dicttoolz import valmap from collections import Counter import pandas as pd import json import gzip import numpy as np import pandas as pd import dbpedia_config target_folder = dbpedia_config.TARGET_FOLDER """ Explanation: Words Associat...
tdhopper/notes-on-dirichlet-processes
pages/2015-10-07-econtalk-topics.ipynb
mit
%matplotlib inline import pyLDAvis import json import sys import cPickle from microscopes.common.rng import rng from microscopes.lda.definition import model_definition from microscopes.lda.model import initialize from microscopes.lda import utils from microscopes.lda import model, runner from numpy import genfromtxt ...
mne-tools/mne-tools.github.io
0.20/_downloads/5f84ce88b4773e5ca1f9b3502aef334a/plot_eeg_erp.ipynb
bsd-3-clause
import mne from mne.datasets import sample """ Explanation: EEG processing and Event Related Potentials (ERPs) :depth: 1 End of explanation """ data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif' event_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw-eve.f...
pyreaclib/pyreaclib
examples/pynucastro-examples.ipynb
bsd-3-clause
import pynucastro as pyrl """ Explanation: pynucastro usage examples This notebook illustrates some of the higher-level data structures in pynucastro. Note to run properly, you install pynucastro via: python setup.py install (optionally with --user) or make sure that you have pynucastro/ in your PYTHONPATH End of expl...
bhattacharjee/courses
CourseraDeepLearningSpecialization/2.HyperparameterTrainingRegularizationAndOptimization/Week2/Exercises/Optimization+methods.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import scipy.io import math import sklearn import sklearn.datasets from opt_utils import load_params_and_grads, initialize_parameters, forward_propagation, backward_propagation from opt_utils import compute_cost, predict, predict_dec, plot_decision_boundary, load_data...
hail-is/hail
datasets/notebooks/GTEx_Tables.ipynb
mit
# Generate list of all eQTL all association files in gs://gtex-resources list_eqtl_files_gz = subprocess.run(["gsutil", "-u", "broad-ctsa", "ls", "gs://gtex-resources/GTEx_...
henchc/Rediscovering-Text-as-Data
08-Classification/02-Underwood-Sellers.ipynb
mit
metadata_tb = Table.read_table('data/poemeta.csv', keep_default_na=False) metadata_tb.show(5) """ Explanation: This notebook is designed to reproduce several findings from Ted Underwood and Jordan Sellers's article "How Quickly Do Literary Standards Change?" (draft (2015), forthcoming in <i>Modern Language Quarterly</...
ucsd-ccbb/visJS2jupyter
notebooks/autism_prioritization/validate_heat_prop_autism_2.ipynb
mit
# import standard scientific computing tools import matplotlib.pyplot as plt import pandas as pd import numpy as np import networkx as nx # use mygene.info to translate between entrez and gene symbol import mygene mg = mygene.MyGeneInfo() # latex rendering of text in graphs import matplotlib as mpl mpl.rc('text...
mklokocka/seminator
notebooks/bSCC.ipynb
gpl-3.0
def example(**opts): in_a = spot.translate("(FGp2 R !p2) | GFp1") in_a.highlight_states([3,4], 2).set_name("input") # Note: the pure=True option disables all optimizations that are usually on by default. out_a = seminator(in_a, pure=True, postprocess=False, highlight=True, **opts) out_a.set_name("ou...
tpin3694/tpin3694.github.io
machine-learning/dimensionality_reduction_with_pca.ipynb
mit
# Load libraries from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn import datasets """ Explanation: Title: Dimensionality Reduction With PCA Slug: dimensionality_reduction_with_pca Summary: How to reduce the dimensions of the feature matrix for machine learning in Pyth...
AWS-Spot-Analysis/spot-analysis
plot_stock_market.ipynb
apache-2.0
print(__doc__) # Author: Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import datetime import numpy as np import matplotlib.pyplot as plt try: from matplotlib.finance import quotes_historical_yahoo_ochl except ImportError: # quotes_historical_yahoo_ochl was named quotes_historical_yaho...
wangyum/spark
python/docs/source/getting_started/quickstart_df.ipynb
apache-2.0
from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() """ Explanation: Quickstart: DataFrame This is a short introduction and quickstart for the PySpark DataFrame API. PySpark DataFrames are lazily evaluated. They are implemented on top of RDDs. When Spark transforms data, it does not immedi...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/launching_into_ml/solutions/basic_intro_logistic_regression.ipynb
apache-2.0
import os import matplotlib.pyplot as plt import tensorflow as tf print("TensorFlow version: {}".format(tf.__version__)) print("Eager execution: {}".format(tf.executing_eagerly())) """ Explanation: Introduction to Logistic Regression Using TF 2.0 Learning Objectives Build a model, Train this model on example data, ...
ud3sh/coursework
deeplearning.ai/coursera-improving-neural-networks/week2/Optimization_methods_v1b.ipynb
unlicense
import numpy as np import matplotlib.pyplot as plt import scipy.io import math import sklearn import sklearn.datasets from opt_utils_v1a import load_params_and_grads, initialize_parameters, forward_propagation, backward_propagation from opt_utils_v1a import compute_cost, predict, predict_dec, plot_decision_boundary, l...
jsub10/Machine-Learning-By-Example
Chapter-6-Non-Linear-Logistic-Regression.ipynb
gpl-3.0
# Use the functions from another notebook in this notebook %run SharedFunctions.ipynb # Import our usual libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Think Like a Machine - Chapter 6 Non-Linear Logistic Regression (and Regularization) ACKNOWLEDGE...
anthonyng2/FX-Trading-with-Python-and-Oanda
Oanda v20 REST-oandapyV20/01.02 Understanding the Documentations.ipynb
mit
import oandapyV20 from oandapyV20 import API import oandapyV20.endpoints.pricing as pricing """ Explanation: <!--NAVIGATION--> < Setting Up | Contents | Rates Information > Understanding the Documentations In order to make use of the API effective, we need to understand the input parameters and the corresponding outpu...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/projects/01-first-neural-network/notebooks/Your_first_neural_network_v0.01.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
bloomberg/bqplot
examples/Marks/Object Model/Graph.ipynb
apache-2.0
fig_layout = Layout(width="960px", height="500px") """ Explanation: Nodes and Links should be supplied to the Graph mark. <p>Node attributes | Attribute| Type | Description | Default | |:----------:|:-------------:|:------:| | label | str | node label | mandatory attribute | | label_display | {center, out...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a/td1a_cenonce_session5.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 1A.2 - Classes, méthodes, attributs, opérateurs et carré magique Les classes proposent une façon différente de structurer un programme informatique. Pas indispensable mais souvent élégant. End of explanation """ class MesParametres: ...
slimn/Data-Analyst
P2-Investigate Titanic data/Investigate_titanic_data.ipynb
gpl-2.0
# file location file_path = "./titanic_data.csv" # import pandas import numpy as np import pandas as pd def get_dataframe(csv_file): '''read .csv file. parameters: ----------- csv_file : a file path in csv format. return: ----------- return pandas dataframe ''' return ...
ceos-seo/data_cube_notebooks
notebooks/water/coastline/Coastal_Change_Classifier.ipynb
apache-2.0
import sys import os sys.path.append(os.environ.get('NOTEBOOK_ROOT')) %matplotlib inline from datetime import datetime import numpy as np import utils.data_cube_utilities.dc_utilities as utils from utils.data_cube_utilities.clean_mask import landsat_qa_clean_mask from utils.data_cube_utilities.dc_mosaic import crea...
hasadna/knesset-data-pipelines
jupyter-notebooks/Extract_meeting_topics/Calculate_topics-analysis_and_graphs.ipynb
mit
import pandas as pd from matplotlib import pyplot as plt import warnings warnings.filterwarnings('ignore') # Normalize the topics' scores def normalize_scores(scores): max_i = (0, -1) second_i = (0, -1) third_i = (0, -1) for i in range(len(scores)): if scores[i] != 0: if scores[i] >...
italoPontes/Machine-learning
Tarefas/Implementando-Regressao-Multipla-do-Zero/.ipynb_checkpoints/Regressão Linear Simples-checkpoint.ipynb
lgpl-3.0
import numpy as np import math import time """ Explanation: Regressão Linear com NumPy End of explanation """ # y = mx + b # m is slope, b is y-intercept def compute_mse(b, m, points): totalError = 0 for i in range(0, len(points)): x = points[i, 0] y = points[i, 1] totalError += (y - ...
google-research/torchsde
examples/demo.ipynb
apache-2.0
import torch from torch import nn import os import sys module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) %matplotlib inline import matplotlib.pyplot as plt import torchsde def plot(ts, samples, xlabel, ylabel, title=''): ts = ts.cpu() samples ...
opesci/notebooks
AcousticFWI/MultiOrder_2d-3d.ipynb
bsd-3-clause
# Choose dimension (2 or 3) dim = 2 # Choose order time_order = 6 space_order = 12 # half width for indexes, goes from -half to half width_t = int(time_order/2) width_h = int(space_order/2) # Define functions and symbols p=Function('p') s,h = symbols('s h') if dim==2: m=M(x,z) q=Q(x,z,t) d=D(x,z,t) so...
tpin3694/tpin3694.github.io
machine-learning/create_interaction_features.ipynb
mit
# Load libraries from sklearn.preprocessing import PolynomialFeatures import numpy as np """ Explanation: Title: Create Interaction Features Slug: create_interaction_features Summary: How to create interaction features for machine learning in Python. Date: 2016-09-06 12:00 Category: Machine Learning Tags: Preproce...
wdbm/Psychedelic_Machine_Learning_in_the_Cenozoic_Era
Keras_CNN_newsgroups_text_classification.ipynb
gpl-3.0
%autosave 120 import numpy as np np.random.seed(1337) from IPython.display import SVG from keras.models import Model from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.layers import ( Concatenate, Conv1D, Dense, Dropout, Embedding, Fl...
jinntrance/MOOC
coursera/ml-regression/assignments/week-4-ridge-regression-assignment-2-blank.ipynb
cc0-1.0
import graphlab """ Explanation: Regression Week 4: Ridge Regression (gradient descent) In this notebook, you will implement ridge regression via gradient descent. You will: * Convert an SFrame into a Numpy array * Write a Numpy function to compute the derivative of the regression weights with respect to a single feat...
ES-DOC/esdoc-jupyterhub
notebooks/csiro-bom/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', 'csiro-bom', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: CSIRO-BOM Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiati...
folivetti/BIGDATA
Spark/Lab04.ipynb
mit
import os import numpy as np def parseRDD(point): """ Parser for the current dataset. It receives a data point and return a sentence (third field). Args: point (str): input data point Returns: str: a string """ data = point.split('\t') return (int(data[0]),data[2]) ...
napsternxg/gensim
docs/notebooks/Poincare Evaluation.ipynb
gpl-3.0
% cd ../.. # Some libraries need to be installed that are not part of Gensim ! pip install click>=6.7 nltk>=3.2.5 prettytable>=0.7.2 pygtrie>=2.2 import csv from collections import OrderedDict from IPython.display import display, HTML import logging import os import pickle import random import re import click from g...
hannorein/rebound
ipython_examples/PoincareSurfaceOfSection.ipynb
gpl-3.0
import rebound import numpy as np import matplotlib.pyplot as plt def get_sim(m_pert,n_pert,a_tp,l_pert,l_tp,e_tp,pomega_tp): sim = rebound.Simulation() sim.add(m=1) P_pert = 2 * np.pi / n_pert sim.add(m=m_pert,P=P_pert,l=l_pert) sim.add(m=0.,a = a_tp,l=l_tp,e=e_tp,pomega=pomega_tp) sim.move_to...
GHorace/ma2823_2016
lab_notebooks/Lab 6 2016-11-04 Tree-based methods.ipynb
mit
import numpy as np %pylab inline # Load the data # TODO # Normalize the data from sklearn import preprocessing X = preprocessing.normalize(X) # Set up a stratified 10-fold cross-validation from sklearn import cross_validation folds = cross_validation.StratifiedKFold(y, 10, shuffle=True) def cross_validate(design_ma...
AndreySheka/dl_ekb
hw4/Seminar4-ru-mnist.ipynb
mit
!pip install install Theano==0.8.2 !pip install https://github.com/Lasagne/Lasagne/archive/master.zip import numpy as np def sum_squares(N): return сумма квадратов чисел от 0 до N %%time sum_squares(10**8) """ Explanation: Theano, Lasagne и с чем их едят разминка напиши на numpy функцию, которая считает сумму к...
mohanprasath/Course-Work
coursera/python_for_data_science/2.4_Sets.ipynb
gpl-3.0
set1={"pop", "rock", "soul", "hard rock", "rock", "R&B", "rock", "disco"} set1 """ Explanation: <a href="http://cocl.us/topNotebooksPython101Coursera"><img src = "https://ibm.box.com/shared/static/yfe6h4az47ktg2mm9h05wby2n7e8kei3.png" width = 750, align = "center"></a> <a href="https://www.bigdatauniversity.com"><img ...
GoogleCloudPlatform/gcp-getting-started-lab-jp
machine_learning/cloud_ai_building_blocks/sight_ja.ipynb
apache-2.0
import getpass APIKEY = getpass.getpass() """ Explanation: <a href="https://colab.research.google.com/github/GoogleCloudPlatform/gcp-getting-started-lab-jp/blob/master/machine_learning/cloud_ai_building_blocks/sight_ja.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Ope...
amirziai/learning
deep-learning/Tensorflow-Tutorial.ipynb
mit
import math import numpy as np import h5py import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.python.framework import ops from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict %matplotlib inline np.random.seed(1) """ Explanation: TensorFlow Tutorial Welcome to this w...
brookisme/gitnb
GitNB Example Notebook.ipynb
mit
1+1 """ Explanation: This is an example notebook The main purpose of this notebook is to have something to convert with gitnb. There is nothing interesting to see here. In order to make this point perfectly clear, I will start with some difficult math... End of explanation """ import numpy as np eps=1e-10 def pre...
espressomd/espresso
doc/tutorials/raspberry_electrophoresis/raspberry_electrophoresis.ipynb
gpl-3.0
import espressomd import espressomd.interactions import espressomd.electrostatics import espressomd.lb import espressomd.virtual_sites import sys import tqdm import logging logging.basicConfig(level=logging.INFO, stream=sys.stdout) espressomd.assert_features(["ELECTROSTATICS", "ROTATION", "ROTATIONAL_INERTIA", "EXTER...
xpharry/Udacity-DLFoudation
tutorials/sentiment_network/.ipynb_checkpoints/Sentiment Classification - Project 3 Solution-checkpoint.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()...
inakic/matsoft
Numpy.ipynb
unlicense
from numpy import * """ Explanation: Numpy numpy je paket (modul) za (efikasno) numeričko računanje u Pythonu. Naglasak je na efikasnom računanju s nizovima, vektorima i matricama, uključivo višedimenzionalne stukture. Napisan je u C-u i Fortanu te koristi BLAS biblioteku. End of explanation """ v = array([1,2,3,4])...
eweill/DeepROAD
Samples/TensorFlow/DeepMNISTForExperts.ipynb
mit
!sudo unlink /usr/local/cuda !sudo ln -s /usr/local/cuda-7.5 /usr/local/cuda """ Explanation: Deep MNIST for Experts End of explanation """ from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data/', one_hot=True) """ Explanation: TensorFlow is a powerful library for ...
mauriciogtec/PropedeuticoDataScience2017
Alumnos/MiguelCastañeda/Tarea2_MiguelCastañeda.ipynb
mit
%matplotlib inline from PIL import Image import numpy as np import matplotlib.pyplot as plt def readImage(pathFile): im = Image.open(pathFile) im = im.convert('LA') plt.figure(figsize=(6, 3)) plt.imshow(im,cmap='gray') data = np.array(list(im.getdata(band=0)),int) data.shape = (im.size[1], im....
jgrizou/explauto
notebook/summary_available_models.ipynb
gpl-3.0
from explauto.environment.environment import Environment environment = Environment.from_configuration('simple_arm', 'mid_dimensional') """ Explanation: Summary of Available Sensorimotor and Interest Models In this notebook, we summarize the different sensorimotor and interest models available in the Explauto library, ...
erikdrysdale/erikdrysdale.github.io
_rmd/extra_cord19/incubation_pediatric.ipynb
mit
import numpy as np import pandas as pd import os import re import seaborn as sns from datetime import datetime as dt from support_funs_incubation import stopifnot, uwords, idx_find, find_beside, ljoin, sentence_find, record_vals !pip install ansicolors # Takes a tuple (list(idx), sentence) and will print in red anyt...
nwfpug/meetings
2017-01-23/pandas.ipynb
gpl-3.0
# conventional way to import pandas import pandas as pd # get Pansda's vesrion # print ('Pandas version', pd.__version__) """ Explanation: Python pandas Q&A video series by Data School YouTube playlist and GitHub repository Table of contents <a href="#1.-What-is-pandas%3F-%28video%29">What is pandas?</a> <a href="#2....
cfe-lab/MiCall
docs/compute_micall_results.ipynb
agpl-3.0
from pathlib import Path import os import csv import pandas as pd import yaml import numpy as np import statistics from operator import itemgetter def get_mixtures(row): total = row['A'] + row['T'] + row['C'] + row['G'] thresh = 0.05 * total alleles = { 'qpos': int(row['query.nuc.pos']), 'm...
mitchshack/data_analysis_with_python_and_pandas
5 - pandas Advanced/5-1 Pandas IO Data, Different Ways of Indexing Data, Hierarchical Indexing and Panels.ipynb
apache-2.0
import pandas.io.data ?pandas.io.data # <tab> """ Explanation: In this section we will be analyzing some financial data. Now pandas gives us access to some data through pandas.io.data This is basically pandas remote data access: http://pandas.pydata.org/pandas-docs/stable/remote_data.html Functions from pandas.io.dat...
michrawson/nyu_ml_lectures
notebooks/01.3 Data Representation for Machine Learning.ipynb
cc0-1.0
from sklearn.datasets import load_iris iris = load_iris() """ Explanation: Representation and Visualization of Data Machine learning is about creating models from data: for that reason, we'll start by discussing how data can be represented in order to be understood by the computer. Along with this, we'll build on our...
sdpython/actuariat_python
_doc/notebooks/decouverte/pandas_start.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: DataFrames Pandas Un Data Frame est un objet qui est présent dans la plupart des logiciels de traitements de données, c’est une matrice à 2 dimensions, chaque colonne a un type et toutes les cellules de cette colonne sont de ce type (nomb...
qutip/qutip-notebooks
examples/piqs-spin-squeezing-noise.ipynb
lgpl-3.0
from time import clock from scipy.io import mmwrite import matplotlib.pyplot as plt from qutip import * from qutip.piqs import * from scipy.sparse import load_npz, save_npz def isdicke(N, j, m): """ Check if an element in a matrix is a valid element in the Dicke space. Dicke row: j value index. Dicke colum...
spulido99/Programacion
Alex/.ipynb_checkpoints/Taller 2 - Archivos y Bases de Datos-checkpoint.ipynb
mit
import mysql.connector """ Explanation: Archivos y Bases de datos End of explanation """ import pandas as pd df= pd.read_csv('C:/Users/Alex/Documents/eafit/semestres/X semestre/programacion/taller2.tsv', sep = '\t') df[:1] """ Explanation: La idea de este taller es manipular archivos (leerlos, parsearlos y escribi...
enoordeh/StatisticalMethods
examples/StraightLine/ModelEvaluation.ipynb
gpl-2.0
%load_ext autoreload %autoreload 2 from __future__ import print_function import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (6.0, 6.0) plt.rcParams['savefig.dpi'] = 100 from straightline_utils import * """ Explanation: Testing the Straight Line Model End of expla...
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/03_persistence/WIN-190810170510.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: WMI Eventing Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/08/10 | | modification date | 2020/09/20 | | playbook related | [] | Hypothesis A...
Lattecom/HYStudy
scripts/[HYStudy 28th] Decorator Pattern 3.ipynb
mit
class DecoClass: def __init__(self, function): self.function = function print("DecoClass '__init__' function has been called.") def __call__(self, *args, **kwargs): print("DecoClass has been called.") return self.function(*args, **kwargs) @DecoClass def func_1(): pr...
WormLabCaltech/mprsq
src/stats_tutorials/Orthogonal Distance Regression.ipynb
mit
import numpy as np import scipy as scipy import scipy.odr as odr import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns from matplotlib import rc # set to use tex, but make sure it is sans-serif fonts only rc('text', usetex=True) rc('text.latex', preamble=r'\usepackage{cmbright}') rc('font', *...
DJCordhose/ai
notebooks/workshops/tss/nn-intro.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...
mediagit2016/workcamp-maschinelles-lernen-grundlagen
18-01-22-workcamp-ml/18-01-22-workcamp-ml-pandas-grundlagen-30.ipynb
gpl-3.0
import pandas as pd dateipfad = 'SN_d_tot_V2.0.csv' sunsets = pd.read_csv(dateipfad, sep=';', header=None) sunsets.info() sunsets.head(10) """ Explanation: <h1>Workcamp Maschinelles Lernen</h1> <h2>Grundlagen - Arbeiten mit Panda Dataframes</h2> <h3>EInlesen von Dateien in Dataframes</h3> Lassen Sie uns jetzt unsere ...
ES-DOC/esdoc-jupyterhub
notebooks/cams/cmip6/models/sandbox-2/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cams', 'sandbox-2', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: CAMS Source ID: SANDBOX-2 Topic: Aerosol Sub-Topics: Transport, Emissions, Conce...
ShiroJean/Breast-cancer-risk-prediction
.ipynb_checkpoints/Breast-cancer-clean-checkpoint.ipynb
mit
#load dataset from ucsi website import pandas as pd df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/wdbc.data', header=None) df.head() """ Explanation: Dataset Breast Cancer Wisconsin dataset, which contains 569 samples of malignant and benign tumor cells. * The fir...
nkarast/notebooks
.ipynb_checkpoints/sympy-checkpoint.ipynb
mit
from sympy import * 3 + math.sqrt(3) expr = 3 * sqrt(3) expr init_printing(use_latex='mathjax') expr expr = sqrt(8) expr """ Explanation: Tutorial Brief SymPy is symbolic mathematics library written completely in Python and doesn't require any dependencies. Finding Help: http://docs.sympy.org/latest/index.html h...
gonzmg88/cnn_basic_course
FC_and_CNN.ipynb
gpl-3.0
import numpy as np import dogs_vs_cats as dvc import matplotlib.pyplot as plt %matplotlib inline all_files = dvc.image_files() n_images_train=5000 n_images_val=500 n_images_test=500 input_image_shape = (50,50,3) train_val_features, train_val_labels,train_val_files, \ test_features, test_labels, test_files = dvc.trai...
geoneill12/phys202-2015-work
assignments/assignment07/AlgorithmsEx01.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np """ Explanation: Algorithms Exercise 1 Imports End of explanation """ def tokenize(s, stop_words=None, punctuation='`~!@#$%^&*()_-+={[}]|\:;"<,>.?/}\t'): """Split a string into a list of words, removing punctuation and stop words.""" ...
AkshanshChahal/BTP
Satellite/Learning from Data.ipynb
mit
select = colss[8:226] X = rice[select] y = rice["Value"]*1000 X.describe() # Z-Score Normalization colms = list(X.columns) for col in colms: col_zscore = col + '_zscore' X[col_zscore] = (X[col] - X[col].mean())/X[col].std(ddof=0) cols = list(X.columns.values) len(cols) # Contains all the features (Last 2...
Kaggle/learntools
notebooks/pandas/raw/tut_0.ipynb
apache-2.0
import pandas as pd """ Explanation: Introduction In this micro-course, you'll learn all about pandas, the most popular Python library for data analysis. Along the way, you'll complete several hands-on exercises with real-world data. We recommend that you work on the exercises while reading the corresponding tutorial...
nwjs/chromium.src
third_party/tensorflow-text/src/docs/guide/decoding_api.ipynb
bsd-3-clause
#@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...
fujii-team/Henbun
notebooks/GaussianProcess.ipynb
apache-2.0
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import tensorflow as tf import Henbun as hb # random state rng = np.random.RandomState(0) """ Explanation: Gaussian Process Demo This notebook briefly describes how to make an variational inference with Henbun. Keisuke Fujii, 21st Nov. 2016 We sho...
azjps/usau-py
notebooks/2018_D-I_College_Nationals_Fantasy_Stats_Day4.ipynb
mit
from usau.reports import USAUResults as Results %matplotlib inline import matplotlib import matplotlib.pyplot as plt import seaborn as sns sns.set_style("whitegrid") matplotlib.rcParams.update({'font.size': 16}) style_args = {"alpha": 0.5, "markeredgewidth": 0.5} sns_blue, sns_orange, sns_green, sns_red, *sns_pallete...
rpmuller/TightBinding
Harry Tight Binding.ipynb
bsd-2-clause
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from numpy.linalg import eigvalsh from collections import namedtuple import TB TB.band(TB.Si) TB.band(TB.GaAs) TB.band(TB.Ge) """ Explanation: Tight Binding program to compute the band structure of simple semiconductors. Parameters taken from Vo...
tesera/pygypsy
notebooks/#32-address-testing-findings/#32-isolated-profiling-4.ipynb
mit
%%timeit pass %%timeit pass """ Explanation: Recap In order of priority/time taken basalareaincremementnonspatialaw this is actually slow because of the number of times the BAFromZeroToDataAw function is called as shown above relaxing the tolerance may help indeed the tolerance is 0.01 * some value while the other f...
google-coral/tutorials
retrain_ssdlite_mobiledet_qat_tf1.ipynb
apache-2.0
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
pdamodaran/yellowbrick
examples/zjpoh/stacked_feature_importance.ipynb
apache-2.0
import os import sys sys.path.insert(0, "../..") import importlib import numpy as np import pandas as pd import yellowbrick import yellowbrick as yb from yellowbrick.features.importances import FeatureImportances import matplotlib as mpl import matplotlib.pyplot as plt from sklearn import manifold, datasets from skle...
mne-tools/mne-tools.github.io
0.20/_downloads/2784a8d5822ed9797c0330f973573c10/plot_stats_cluster_erp.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt from scipy.stats import ttest_ind import mne from mne.channels import find_ch_connectivity, make_1020_channel_selections from mne.stats import spatio_temporal_cluster_test np.random.seed(0) # Load the data path = mne.datasets.kiloword.data_path() + '/kword_metadata-...
chungjjang80/FRETBursts
notebooks/FRETBursts - ns-ALEX example.ipynb
gpl-2.0
from fretbursts import * sns = init_notebook() """ Explanation: FRETBursts - ns-ALEX example This notebook is part of a tutorial series for the FRETBursts burst analysis software. For a step-by-step introduction to FRETBursts usage please refer to us-ALEX smFRET burst analysis. In this notebook we present a typical...
ishakaur/sandbox
caltech_machine_learning/homework 4 (VC bounds, aggregate hypotheses and bias-variance analysis.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import display # Generalization bound (VC dimension) # δ = 4 * (mH(2N)) * e ^ (- epsilon ^ 2 * N / 8) # epsilon = sqrt((8 * logn(4 * (mH(2N)) / δ)) / N) = Omega(N, H, δ) # Replacing growth function with the s...
plipp/informatica-pfr-2017
nbs/4/1-Classification-Decision-Tree-Primer.ipynb
mit
from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from plotting_utilities import plot_decision_tree, plot_feature_importances from sklearn.model_selection import train_test_split import numpy as np import matplotlib.pyplot as plt %matplotlib inline iris = load_iris() iris.DESCR.s...
t-vi/pytorch-tvmisc
misc/pytorch_automatic_optimization_jit.ipynb
mit
import torch import torch.utils.cpp_extension """ Explanation: Automatic optimization with the PyTorch JIT a worked example by Thomas Viehmann &#116;&#118;&#64;&#108;&#101;&#114;&#110;&#97;&#112;&#112;&#97;&#114;&#97;&#116;&#46;&#100;&#101; Today, I would like to discuss in detail some aspects of optimizing code in mo...
AssembleSoftware/IoTPy
examples/ExamplesOfMulticorePartTwo.ipynb
bsd-3-clause
import threading from IoTPy.agent_types.sink import stream_to_queue def f(in_streams, out_streams): map_element(lambda v: v+100, in_streams[0], out_streams[0]) def source_thread_target(procs): for i in range(3): extend_stream(procs, data=list(range(i*2, (i+1)*2)), stream_name='x') time.sleep(0...
mungobungo/deep
part3.ipynb
mit
import matplotlib.pyplot as plt hist = history train_loss=hist.history['loss'] val_loss=hist.history['val_loss'] train_acc=hist.history['acc'] val_acc=hist.history['val_acc'] xc=range(epochs) plt.figure(1,figsize=(7,5)) plt.plot(xc,train_loss) plt.plot(xc,val_loss) plt.xlabel('num of Epochs') plt.ylabel('loss') plt....
andreyf/machine-learning-examples
visualization/telecom_churn_inclass_as_is.ipynb
gpl-3.0
df['Total day minutes'].hist(); sns.boxplot(df['Total day minutes']); df.hist(); """ Explanation: 1. Признаки по одному 1.1. Количественные Гистограмма и боксплот End of explanation """ df['State'].value_counts().head() df['Churn'].value_counts() sns.countplot(df['Churn']); sns.countplot(df['State']); sns.coun...
arturops/deep-learning
tv-script-generation/dlnd_tv_script_generation.ipynb
mit
""" 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...
BradHub/SL-SPH
BEM_problem.ipynb
mit
#Q = 2000/3 #strength of the source-sheet,stb/d h=25.26 #thickness of local gridblock,ft phi=0.2 #porosity kx=200 #pemerability in x direction,md ky=200 #pemerability in y direction,md kr=kx/ky #pemerability ratio miu=1 #viscosity,cp Nw=1 #Number of well Qwell...
avincartemard/avincartemard.github.io
content/articles/2017/07/stochastic-optimization/stochastic-optimization.ipynb
apache-2.0
import numpy as np from scipy.io import loadmat # load data from MATLAB file datamat = loadmat('quantum.mat') X = datamat['X'] y = datamat['y'] class LogisticRegressionSGD(object): def __init__(self, X, y, progTol=1e-4, nEpochs=10): self.X = X self.y = y self.n, self.d = X.shape ...
flohorovicic/pynoddy
docs/notebooks/Marks Fault Uncertainty Study.ipynb
gpl-2.0
# some basic inputs and settings import sys, os import matplotlib.pyplot as plt # adjust some settings for matplotlib from matplotlib import rcParams # print rcParams rcParams['font.size'] = 15 # determine path of repository to set paths corretly below os.chdir(r'/Users/Florian/git/pynoddy/docs/notebooks/')# some basic...
daniel-koehn/Theory-of-seismic-waves-II
06_2D_SH_Love_wave_modelling/4_2D_SH_FD_modelling_Love_waves.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 © 2018 by D. Koehn, notebook styl...
snucsne/CSNE-Course-Source-Code
CSNE2444-Intro-to-CS-I/jupyter-notebooks/ch11-dictionaries.ipynb
mit
birthdays = dict() print( birthdays ) """ Explanation: Chapter 11: Dictionaries Contents - A dictionary is a mapping - Dictionary as a set of counters - Looping and dictionaries - Reverse lookup - Dictionaries and lists - Global variables - Debugging - Exercises This notebook is based on "Think Python, 2Ed" by Allen...
ES-DOC/esdoc-jupyterhub
notebooks/dwd/cmip6/models/sandbox-3/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-3', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: DWD Source ID: SANDBOX-3 Topic: Landice Sub-Topics: Glaciers, Ice. Properties: 3...