repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
vikasgorur/notebooks
deep-learning/1_notmnist.ipynb
mit
# Config the matlotlib backend as plotting inline in IPython %matplotlib inline # These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from...
robcarver17/pysystemtrade
docs/notebooks/introduction_with_fxdata.ipynb
gpl-3.0
from sysbrokers.IB.ib_connection import connectionIB from sysbrokers.IB.ib_Fx_prices_data import ibFxPricesData from ib_insync import util util.startLoop() #only required when running inside a notebook """ Explanation: Modified introduction using forex data This is the trading rule example shown in the introduction b...
GoogleCloudPlatform/public-datasets-pipelines
datasets/gbif/docs/tutorials/biodiversity_map/australia.ipynb
apache-2.0
%%capture # Installing the required libraries: !pip install matplotlib pandas scikit-learn tensorflow pyarrow tqdm !pip install google-cloud-bigquery google-cloud-bigquery-storage !pip install flake8 pycodestyle pycodestyle_magic geopandas # Python Builtin Libraries # Third Party Libraries import numpy as np import ...
nimagh/MachineLearning
DimenstionalityReduction/DimensionalityReduction.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize from scipy.io import loadmat from scipy.stats import multivariate_normal from scipy.linalg import det from scipy.linalg import pinv2 as inv #pinv uses linalg.lstsq algorithm while pinv2 uses SVD from scipy.linalg import sqrtm from...
statsmodels/statsmodels.github.io
v0.12.2/examples/notebooks/generated/robust_models_0.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std """ Explanation: Robust Linear Models End of explanation """ data = sm.datasets.stackloss.load(as_pandas=False) data.exog = sm.add_constant(data.ex...
metpy/MetPy
v0.6/_downloads/isentropic_example.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt from netCDF4 import Dataset, num2date import numpy as np import metpy.calc as mcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo from metpy.units import units """ Explanation: Isentropic Analy...
4DGenome/Chromosomal-Conformation-Course
Notebooks/A1-Preparation_reference_genome.ipynb
gpl-3.0
species = 'Homo sapiens' taxid = '9606' genome = 'GRCh38.p10' refseq, dir1, dir2, dir3 = 'GCF', '000', '001', '405' genbank = 'GCF_000001405.36' sumurl = 'ftp://ftp.ncbi.nlm.nih.gov/genomes/all/{0}/{1}/{2}/{3}/{4}_{5}/{4}_{5}_assembly_report.txt'.format( refseq, dir1, dir2, dir3, genbank, genome) crmurl = 'ht...
tensorflow/neural-structured-learning
research/third_party/denoised_smoothing/notebooks/Train_Denoiser.ipynb
apache-2.0
!git clone https://github.com/sayakpaul/neural-structured-learning !cd neural-structured-learning/research/denoised_smoothing && tar xf models.tar.gz import sys sys.path.append("neural-structured-learning/research/denoised_smoothing") from models import dncnn from tensorflow.keras import layers import tensorflow as ...
dpiparo/swanExamples
notebooks/LHCb_OpenData_Spark.ipynb
lgpl-2.1
# This starts the Spark Session # Note: Shift-Enter can be used to run Jupyter cells # These instructions rely on internet access to download the spark-root package from Maven Central from pyspark.sql import SparkSession spark = SparkSession.builder \ .appName("LHCb Open Data with Spark") \ .config("s...
mit-crpg/openmc
examples/jupyter/mgxs-part-i.ipynb
mit
from IPython.display import Image Image(filename='images/mgxs.png', width=350) """ Explanation: Multigroup Cross Section Generation Part I: Introduction This IPython Notebook introduces the use of the openmc.mgxs module to calculate multi-group cross sections for an infinite homogeneous medium. In particular, this Not...
whitead/numerical_stats
unit_10/hw_2016/homework_9.ipynb
gpl-3.0
from math import erf, sqrt import numpy as np import scipy.stats """ Explanation: Homework 9 CHE 116: Numerical Methods and Statistics Prof. Andrew White Version 1.0 (3/23/2016) End of explanation """ data_1 = [3.05, 3.01, 3.20, 3.16, 3.11, 3.09] data_2 = [3.18, 3.23, 3.19, 3.28, 3.08, 3.18] """ Explanation: Genera...
certik/chess
examples_manual/Convergence2.ipynb
mit
%pylab inline ! grep "multipv 1" log3.txt | grep -v lowerbound | grep -v upperbound > log3_g.txt def parse_info(l): D = {} k = l.split() i = 0 assert k[i] == "info" i += 1 while i < len(k): if k[i] == "depth": D[k[i]] = int(k[i+1]) i += 2 elif k[i] == "...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_home/2021_covid_pickle.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %load_ext pyensae """ Explanation: Sérialisation, pickle, COVID Ce notebook aborde les sujets évoqués dans le titre. End of explanation """ import pandas import numpy mat = numpy.random.randn(10000, 50) df = pandas.DataFrame(mat) df.shape df.size fo...
tholoien/empiriciSN
Notebooks/Demo.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot as plt import corner import urllib import os from sklearn.cross_validation import train_test_split from astroML.plotting import setup_text_plots import empiriciSN from demo_funcs import * """ Explanation: Empirical Supernova Simulation Demo Tom Holoi...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/30_DCGAN_Batch_Normalisation/notebooks/Batch_Normalization_Solutions.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False) """ Explanation: Batch Normalization – Solutions Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a co...
facebook/prophet
notebooks/outliers.ipynb
mit
%%R -w 10 -h 6 -u in df <- read.csv('../examples/example_wp_log_R_outliers1.csv') m <- prophet(df) future <- make_future_dataframe(m, periods = 1096) forecast <- predict(m, future) plot(m, forecast) df = pd.read_csv('../examples/example_wp_log_R_outliers1.csv') m = Prophet() m.fit(df) future = m.make_future_dataframe(...
google/jax-cfd
notebooks/ml_model_inference_demo.ipynb
apache-2.0
#@title Paths to evaluation datasets base_path = '/content/' kolmogorov_re_1000 = { f'baseline_{i}x{i}': os.path.join(base_path, f'eval_{i}x{i}_64x64.nc') for i in [64, 128, 256, 512, 1024, 2048] } decaying = { f'baseline_{i}x{i}': os.path.join(base_path, f'eval_{i}x{i}_64x64.nc') for i in [64, 128, 2...
Diyago/Machine-Learning-scripts
time series regression/DL aproach for timeseries/Air Pressure LSTM.ipynb
apache-2.0
from __future__ import print_function import os import sys import pandas as pd import numpy as np %matplotlib inline from matplotlib import pyplot as plt import seaborn as sns import datetime #Read the dataset into a pandas.DataFrame df = pd.read_csv('datasets/PRSA_data_2010.1.1-2014.12.31.csv') print('Shape of the d...
Santana9937/Regression_ML_Specialization
Week_4_Ridge_Regression/assign_1_ridge-regression.ipynb
mit
import os import zipfile import numpy as np import pandas as pd from sklearn import linear_model import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns sns.set_style('darkgrid') %matplotlib inline """ Explanation: Regression Week 4: Ridge Regression (interpretation) In this notebook, we will ru...
vishaalprasad/AnimeRecommendation
notebooks/exploration/using_pretrained_cnn.ipynb
mit
import numpy as np import tensorflow as tf import os.path as osp """ Explanation: This notebook is an attempt to test and prototype using a pretrained tensorflow CNN to do classification. The end goal is to be able to take add the following as an anime-specific feature: a CNN's embeddings of the default image on MyAni...
Benedicto/ML-Learning
Classifier_3_decision_tree_assignment_1.ipynb
gpl-3.0
import graphlab graphlab.canvas.set_target('ipynb') """ Explanation: Identifying safe loans with decision trees The LendingClub is a peer-to-peer leading company that directly connects borrowers and potential lenders/investors. In this notebook, you will build a classification model to predict whether or not a loan pr...
2php/CodeToolKit
9.caffe-ssd/examples/ssd_detect.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10, 10) plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' # Make sure that caffe is on the python path: caffe_root = '../' # this file is expected to be in {caffe_root}/examples i...
turbomanage/training-data-analyst
bootcamps/imagereco/fashion_cnn_batch_dropout_lab.ipynb
apache-2.0
import os PROJECT = 'my-project-id' # REPLACE WITH YOUR PROJECT ID BUCKET = 'my-bucket-name' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 MODEL_TYPE='cnn_batch_norm' # 'cnn_batch_norm' or 'dnn' or 'cnn' # do not change these os.environ['PROJECT'] = PROJECT...
tien-le/uranus
04_model_training.ipynb
mit
from IPython.display import IFrame IFrame('http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data', width=300, height=200) """ Explanation: Training a machine learning model with scikit-learn From the video series: Introduction to machine learning with scikit-learn Agenda What is the K-nearest neighb...
fullmetalfelix/ML-CSC-tutorial
ACSF.ipynb
gpl-3.0
# --- INITIAL DEFINITIONS --- from sklearn.neural_network import MLPRegressor import numpy, math, random import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from visualise import view from ase import Atoms # parameters for the trimer d1 = 1.0 d2 = 1.0 theta = 30 # convert angle to radians theta *= ...
Intel-Corporation/tensorflow
tensorflow/lite/g3doc/tutorials/model_maker_image_classification.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...
dataplumber/nexus
esip-workshop/other-notebooks/Nexus Deployment and Ingestion.ipynb
apache-2.0
cd ~/nexus/esip-workshop/docker/infrastructure docker-compose up -d cassandra1 docker logs -f cassandra1 """ Explanation: Step 1: Sign up / get assigned EC2 instance <br> Step 2: SSH into EC2 instance <br> Step 3: Start up the cluster by running the following commands <br> End of explanation """ docker-compose up -d...
xMyrst/BigData
python/howto/008_Ficheros.ipynb
gpl-3.0
%pwd fichero = open("../datos/cuna.txt") """ Explanation: FICHEROS En Python, para abrir un fichero usaremos la función open, que recibe el nombre del archivo a abrir. Por defecto, si no indicamos nada, el fichero se abre en modo lectura. OPEN: MODO LECTURA End of explanation """ ls "../datos" fichero= open("../da...
xiongzhenggang/xiongzhenggang.github.io
AI/ML/week2逻辑回归代码实现.ipynb
gpl-3.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt # 中文乱码的处理 plt.rcParams['font.sans-serif'] =['Microsoft YaHei'] plt.rcParams['axes.unicode_minus'] = False # 创建一些列数据 #随便创建一些列合适的点,然后画图观察 data = pd.DataFrame({'Exam1':np.concatenate((np.random.uniform(30,60,20),np.random.uniform(60,80,20))),'Exam2':n...
Faris137/MachineLearningArabic
house sales project/kc_house_data/house sales project.ipynb
mit
import numpy as np import pandas as pd import seaborn as sb from sklearn.preprocessing import StandardScaler import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn import linear_model from sklearn.metrics import classification_report %matplotlib inline df = pd.read_csv("kc_h...
janmtl/drift_qec
FullTomographyTrials.ipynb
isc
D = 0.01 N_ERRORS = 1e6 N_TRIALS = 100 N_CYCLES = np.logspace(1, 3, 10).astype(np.int) RECORDS = [] for trial in tqdm(range(N_TRIALS)): for n_cycles in N_CYCLES: n = int(N_ERRORS / n_cycles) channel = Channel(kx=0.7, ky=0.2, kz=0.1, Q=np.linalg.qr(np.random.randn(3,3))[0], ...
xMyrst/BigData
python/howto/004_Estructuras de datos.ipynb
gpl-3.0
# Ejemplo de lista, los valores van entre corchetes una_lista = [4, "Hola", 6.0, 99 ] # Ejemplo de tupla, los valores van entre paréntesis una_tupla = (4, "Hola", 6.0, 99) print ("Lista: " , una_lista) print ("Tupla: " , una_tupla) # Las tuplas y las listas aceptan operadores de comparación y devuelven un booleano pri...
gangadhara691/gangadhara691.github.io
P6 data_viz/data/.ipynb_checkpoints/P2-checkpoint.ipynb
mit
import numpy as np import pandas as pd from IPython.display import display %matplotlib inline # Load the dataset files = "titanic_data.csv" data_titanic = pd.read_csv(files) display(data_titanic.head()) """ Explanation: Titanic Data Analysis By Gangadhara Naga Sai Overview Of Titanic Dataset In 1912, the ship RMS Ti...
llondon6/kerr_public
notes/ns/notebooks/test_phast_shift_mmrdns_gwf.ipynb
mit
# Setup ipython environment %load_ext autoreload %autoreload 2 %matplotlib inline # Import Useful things from kerr import mmrdns from numpy import pi # Setup plotting backend # --- ## MPL import matplotlib as mpl mpl.rcParams['lines.linewidth'] = 0.8 mpl.rcParams['font.family'] = 'serif' mpl.rcParams['font.size'] = ...
NYUDataBootcamp/Projects
MBA_S17/Burrell-Birth Time Frame QB Success.ipynb
mit
# import packages import pandas as pd # data management import matplotlib.pyplot as plt # graphics import urllib import numpy as np # IPython command, puts plots in notebook %matplotlib inline # check Python version import datetime as dt import sys #versino 2.7 #print('Today is', dt.date.t...
stephenpardy/PythonNotebooks
astro/IntroPythonNotebook.ipynb
gpl-2.0
# This line is a comment -- it does nothing # you can add comments using the '#' symbol """ Explanation: Intro to python Basic commands Hello and welcome to the wonderful world of Python. Each of these cells can be copy and pasted into your own notebook. There are code cells and text cells. The code cells execute Pyt...
trangel/Data-Science
deep_learning_ai/Autonomous+driving+application+-+Car+detection+-+v3.ipynb
gpl-3.0
import argparse import os import matplotlib.pyplot as plt from matplotlib.pyplot import imshow import scipy.io import scipy.misc import numpy as np import pandas as pd import PIL import tensorflow as tf from keras import backend as K from keras.layers import Input, Lambda, Conv2D from keras.models import load_model, Mo...
Danghor/Formal-Languages
Python/Equivalence.ipynb
gpl-2.0
%run Regexp-2-NFA.ipynb """ Explanation: Checking the Equivalence of Regular Expressions In order to check whether two regular expressions $r_1$ and $r_2$ are equivalent, perform the following steps: - convert $r_1$ and $r_2$ into non-deterministic <span style="font-variant:small-caps;">Fsm</span>s $F_1$ and $F_2$ ...
basnijholt/holoviews
examples/user_guide/17-Dashboards.ipynb
bsd-3-clause
import pandas as pd import holoviews as hv from bokeh.sampledata import stocks from holoviews.operation.timeseries import rolling, rolling_outlier_std hv.extension('bokeh') """ Explanation: Creating interactive dashboards End of explanation """ def load_symbol(symbol, variable='adj_close', **kwargs): df = pd.D...
johnyquest7/Breast-Cancer-Machine-Learning-Algorithm
Breast cancer predictor.ipynb
mit
# Importing pandas to read CSV file import pandas as pd # Read breast cancer csv file to pandas data frame data data = pd.read_csv('wisconsin_breast_cancer.csv') # Display the first 5 rows of the csv file data.head() data.shape # It is always a good idea to understand your data # There are 699 rows and 11 columns ...
georgetown-analytics/envirohealth
Capstone Data Exploration.ipynb
mit
%matplotlib inline import os import json import time import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt from pandas.tools.plotting import scatter_matrix, radviz, parallel_coordinates """ Explanation: This notebook explores a sample of the SEER breast cancer data First we import the n...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/migration/UJ8 legacy AutoML Natural Language Text Sentiment Analysis.ipynb
apache-2.0
! pip3 install google-cloud-automl """ Explanation: AutoML text sentiment analysis Installation Install the latest version of AutoML SDK. End of explanation """ ! pip3 install google-cloud-storage """ Explanation: Install the Google cloud-storage library as well. End of explanation """ import os if not os.getenv...
markroxor/gensim
docs/notebooks/Poincare Evaluation.ipynb
lgpl-2.1
% cd ../.. % cd docs/notebooks/ import csv from collections import OrderedDict import logging import os import pickle import random import re import click from gensim.models.poincare import PoincareModel, PoincareRelations, \ ReconstructionEvaluation, LinkPredictionEvaluation, \ LexicalEntailmentEvaluation, ...
deepchem/deepchem
examples/tutorials/Molecular_Fingerprints.ipynb
mit
!pip install --pre deepchem """ Explanation: Molecular Fingerprints Molecules can be represented in many ways. This tutorial introduces a type of representation called a "molecular fingerprint". It is a very simple representation that often works well for small drug-like molecules. Colab This tutorial and the rest i...
karlstroetmann/Formal-Languages
Ply/Conflicts-Resolved.ipynb
gpl-2.0
import ply.lex as lex tokens = [ 'NUMBER' ] def t_NUMBER(t): r'0|[1-9][0-9]*' t.value = int(t.value) return t literals = ['+', '-', '*', '/', '^', '(', ')'] t_ignore = ' \t' def t_newline(t): r'\n+' t.lexer.lineno += t.value.count('\n') def t_error(t): print(f"Illegal character '{t.value[...
idealabasu/code_pynamics
python/pynamics_examples/triple_pendulum.ipynb
mit
%matplotlib inline """ Explanation: title: Triple Pendulum Example type: submodule End of explanation """ use_constraints = False """ Explanation: Try running with this variable set to true and to false and see the difference in the resulting equations of motion End of explanation """ # -*- coding: utf-8 -*- """ ...
JorgeDeLosSantos/nusa
docs/nusa-info/es/beam-element.ipynb
mit
%matplotlib inline import numpy as np from nusa import * import itertools import matplotlib.pyplot as plt def pairwise(iterable): #~ "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = itertools.tee(iterable) next(b, None) return zip(a, b) # Input data E = 210e9 # Pa I = 1e-5 L = 1 P = 10e3 nelm = 10 part...
DistrictDataLabs/yellowbrick
examples/pdamodaran/feature_visualizer.ipynb
apache-2.0
import os import sys # Modify the path sys.path.append("..") import pandas as pd import yellowbrick as yb import matplotlib.pyplot as plt g = yb.anscombe() """ Explanation: Feature Visualizer This notebook provides examples of visualizations done in other data studies and modifies them using the Yellowbrick libr...
mbeyeler/opencv-machine-learning
notebooks/10.01-Understanding-Ensemble-Methods.ipynb
mit
from sklearn.ensemble import BaggingClassifier from sklearn.neighbors import KNeighborsClassifier bagging = BaggingClassifier(KNeighborsClassifier(), n_estimators=10) """ Explanation: <!--BOOK_INFORMATION--> <a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><...
TimothyADavis/KinMSpy
kinms/docs/KinMS_example_notebook.ipynb
mit
from kinms import KinMS """ Explanation: <img style="float:top,right" src="Logo.png"> <br><br> Welcome to the KinMS introduction <br><br> Here you will learn how to import and use KinMS to generate mock interferometric data cubes and gain a better understanding of using the functionalities within the package. Copyrig...
xianjunzhengbackup/code
python/read_pdf.ipynb
mit
def init_pdf_from_file(path): fp=open(path,'rb') pdfReader=PyPDF2.PdfFileReader(fp) return pdfReader """ Explanation: 该方法对可以读取PDF文件,它是按行读取,如果每一行中有缺失掉VALUE,那么如何判断这些VALUE是个大问题。 在parse_items函数中碰到的就是这个问题。 End of explanation """ def extract_info_from_page(pdf,num_of_page,pattern): content=pdf.getPage(num_...
mckinziebrandon/DeepChatModels
notebooks/Analysis.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline plt.style.use('ggplot') plt.rcParams['figure.figsize'] = 10, 8 BASE = '/home/brandon/Documents/seq2seq_projects/data/saved_train_data/' path = BASE + 'cornell_03_11.csv' df = pd.read_csv(path, index_col=0) d...
smharper/openmc
examples/jupyter/mg-mode-part-i.ipynb
mit
import os import matplotlib.pyplot as plt import matplotlib.colors as colors import numpy as np import openmc %matplotlib inline """ Explanation: This Notebook illustrates the usage of OpenMC's multi-group calculational mode with the Python API. This example notebook creates and executes the 2-D C5G7 benchmark mode...
jbogaardt/chainladder-python
docs/tutorials/large-datasets.ipynb
mit
import chainladder as cl import numpy as np import pandas as pd %matplotlib inline print('chainladder:' + cl.__version__) print('pandas:' + pd.__version__) """ Explanation: Working with Large Datasets Getting started All exercises rely on chainladder v0.7.5 and later. There have also been breaking changes with pandas...
PyDataMadrid2016/Conference-Info
talks_materials/20160409_1130_Embrace_conda_packages/Embrace conda packages.ipynb
mit
!conda install -y conda-build -q -n root """ Explanation: Embrace conda packages The build system we always needed, but never deserved Juan Luis Cano Rodríguez Madrid, 2016-04-08 Outline Introduction Motivation: What brought us here? Our first conda package Some more tricks Working with other languages conda-forge: a...
cleuton/datascience
datavisualization/data_visualization_python_2.ipynb
apache-2.0
import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d, Axes3D # Objetos que usaremos em nosso gráfico %matplotlib inline df = pd.read_csv('../datasets/evasao.csv') # Dados de evasão escolar que coletei df.head() """ Explanation: Visualização de dados com Python 2 - Visualizações c...
GoogleCloudPlatform/ai-platform-samples
notebooks/samples/tensorflow/prediction_auto-scaling/ai_platform_prediction_auto-scaling.ipynb
apache-2.0
# Change these parameters! PROJECT = 'YOUR-PROJECT-ID' # Update with your project BUCKET = 'gs://YOUR-BUCKET-NAME' # Update with your bucket REGION = 'us-central1' # Update with your region # These parameters don't need to be changed MODULE_URL = "https://tfhub.dev/google/universal-sentence-encoder-large/5" MODEL...
darkomen/TFG
medidas/04082015/estudio.datos.ipynb
cc0-1.0
#Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Abrimos el fichero csv con los datos...
rickiepark/openbidder
notebook/pb_server_test.ipynb
mit
from http.server import BaseHTTPRequestHandler, HTTPServer class HTTPRequestHandler(BaseHTTPRequestHandler): def do_POST(self): length = self.headers['content-length'] data = self.rfile.read(int(length)) with open('sample_message.txt', 'wb') as f: f.write(data) print(dat...
apozas/BIST-Python-Bootcamp
6_Optimization_Integration_ODEs.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set() """ Explanation: 6 Optimizing Parametric Functions, Integration, and ODEs We will cover two things today: Numerical integration of ODE systems Numerical optimization First of all we include some basic packages to ...
usantamaria/iwi131
ipynb/21-EjerciciosDeCertamen/Certamen2_2015_1S_CC.ipynb
cc0-1.0
# n numero entero def f(n): l = [] for i in range(len(str(n))-1,-1,-1): x = n/(10**i) l.append(x) n=n %(10**i) return l f(421) """ Explanation: <header class="w3-container w3-teal"> <img src="images/utfsm.png" alt="" align="left"/> <img src="images/inf.png" alt="" align="right"/> <...
balarsen/pymc_learning
Logit/Boyd Logit 1.ipynb
bsd-3-clause
# http://onlinelibrary.wiley.com/doi/10.1002/2016JA022652/epdf import pymc3 from pprint import pprint import numpy as np import matplotlib.pyplot as plt import spacepy.plot as spp import seaborn as sns import tqdm sns.set(font_scale=1.5) """ Explanation: What is the probability that core PSD rises by >2x as a functi...
cgivre/oreilly-sec-ds-fundamentals
Notebooks/EDA/EDA Worksheet - Python Version - Answers.ipynb
apache-2.0
data = pd.read_csv( '../../data/dailybots.csv' ) #Look at a summary of the data data.describe() data['botfam'].value_counts() """ Explanation: First, load up the data First you're going to want to create a data frame from the dailybots.csv file which can be found in the data directory. You should be able to do this ...
ODM2/ODM2PythonAPI
Examples/TimeSeries_RetrieveVisualize.ipynb
bsd-3-clause
import os import datetime import matplotlib as mpl import matplotlib.pyplot as plt %matplotlib inline import pandas as pd import odm2api from odm2api.ODMconnection import dbconnection import odm2api.services.readService as odm2rs "{} UTC".format(datetime.datetime.utcnow()) pd.__version__ """ Explanation: ODM2 API...
John-Keating/ThinkStats2
code/.ipynb_checkpoints/chap03ex-checkpoint.ipynb
gpl-3.0
%matplotlib inline import chap01soln resp = chap01soln.ReadFemResp() """ Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br> Allen Downey Read the female respondent file. End of explanation """ import thinkstats2 as ts children_PMF = ts.Pmf(resp.numkdhh) """ Explanation: Make a PMF of <tt>nu...
NiceCircuits/solderingPen
doc/design.ipynb
cc0-1.0
#Initialization of iPython, some helper functions. %matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd plt.style.use('ggplot') from sympy import * from IPython.display import display, Math, Latex init_printing(use_latex="mathjax") _Omega=u'\u03A9' def readCsvData(fileName): r...
ARM-software/lisa
ipynb/deprecated/examples/android/workloads/Android_Gmaps.ipynb
apache-2.0
from conf import LisaLogging LisaLogging.setup() %pylab inline import json import os # Support to access the remote target import devlib from env import TestEnv # Import support for Android devices from android import Screen, Workload # Support for trace events analysis from trace import Trace # Suport for FTrace...
ZwickyTransientFacility/simsurvey-examples
simsurvey_demo.ipynb
bsd-3-clause
import os home_dir = os.getcwd() # Please enter the path to where you have placed the Schlegel, Finkbeiner & Davis (1998) dust map files # You can also set the environment variable SFD_DIR to this path (in that case the variable below should be None) sfd98_dir = os.path.join(home_dir, 'data/sfd98') import simsurvey i...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_dics_beamformer.ipynb
bsd-3-clause
# Author: Roman Goj <roman.goj@gmail.com> # # License: BSD (3-clause) import mne import matplotlib.pyplot as plt import numpy as np from mne.datasets import sample from mne.time_frequency import compute_epochs_csd from mne.beamformer import dics print(__doc__) data_path = sample.data_path() raw_fname = data_path +...
sthuggins/phys202-2015-work
assignments/assignment05/.ipynb_checkpoints/InteractEx04-checkpoint.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 4 Imports End of explanation """ def random_line(m, b, sigma, size=10): """Create a line y = m*x + b + N(0,si...
lorgor/vulnmine
vulnmine/ipynb/170525-train-sft-match.ipynb
gpl-3.0
# Initialize import pandas as pd import numpy as np try: df_label_software = pd.io.parsers.read_csv( "/home/jovyan/work/shared/data/csv/label_software.csv", error_bad_lines=False, warn_bad_lines=True, q...
IST256/learn-python
content/lessons/04-Iterations/SmallGroup-Iterations.ipynb
mit
# PROMPT 4 """ Explanation: Now You Code In Class: Gathering Data and Reporting Statistics For this in-class exercise we demonstrate a common programming pattern for reporting statistics on data in real time as it is input. This is used for data collection and real time analyics of time-series data. In this example w...
johngage/Kibera-projects
content/features/notebooks.ipynb
mit
from matplotlib import rcParams, cycler import matplotlib.pyplot as plt import numpy as np plt.ion() # Fixing random state for reproducibility np.random.seed(19680801) N = 10 data = [np.logspace(0, 1, 100) + np.random.randn(100) + ii for ii in range(N)] data = np.array(data).T cmap = plt.cm.coolwarm rcParams['axes.pr...
victorgcapone/data-science-portifolio
Monte Carlos Experiments/Monte Carlo Demonstration.ipynb
gpl-3.0
#First, lets plot a circle, centered arround 0 with a radius of 1 plot_circle() """ Explanation: The Monte Carlo method works by using random points to estimate ratios and values, the most basic example, shown here, is to calculate the value of $\pi$ by comparing the ratio of points in a circle with ones in the inscri...
ES-DOC/esdoc-jupyterhub
notebooks/pcmdi/cmip6/models/pcmdi-test-1-0/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'pcmdi', 'pcmdi-test-1-0', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: PCMDI Source ID: PCMDI-TEST-1-0 Sub-Topics: Radiative Forcings. Propert...
ITAM-DS/analisis-numerico-computo-cientifico
libro_optimizacion/temas/5.optimizacion_de_codigo/5.3/Compilacion_a_C.ipynb
apache-2.0
%%bash lscpu %%bash sudo lshw -C memory %%bash uname -ar #r for kernel, a for all """ Explanation: (COMPC)= 5.3 Compilación a C ```{admonition} Notas para contenedor de docker: Comando de docker para ejecución de la nota de forma local: nota: cambiar &lt;ruta a mi directorio&gt; por la ruta de directorio que se dese...
tdhopper/notes-on-dirichlet-processes
pages/2015-09-02-fitting-a-mixture-model.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import random import matplotlib.pyplot as plt from scipy import stats from collections import namedtuple, Counter """ Explanation: Fitting a Mixture Model with Gibbs Sampling End of explanation """ data = pd.Series.from_csv("clusters.csv") _=data.hist(bins=2...
DS-100/sp17-materials
sp17/disc/disc14/disc14.ipynb
gpl-3.0
import numpy as np import pandas as pd import matplotlib %matplotlib inline import matplotlib.pyplot as plt import matplotlib as mpl """ Explanation: Gaussian Mixture Models End of explanation """ from sklearn.datasets import make_classification np.random.seed(1337) vals = make_classification(n_features=2, ...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/ml_ops/stage6/get_started_with_matching_engine_swivel.ipynb
apache-2.0
import os # The Vertex AI Workbench Notebook product has specific requirements IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME") IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists( "/opt/deeplearning/metadata/env_version" ) # Vertex AI Notebook requires dependencies to be installed with '--user' USER_FLAG = ...
jupyter/nbgrader
nbgrader/tests/apps/files/test.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...
spulido99/NetworksAnalysis
Ejercicios 1.1 - Graphs, Paths & Components.ipynb
mit
edges = set([(1, 2), (3, 1), (3, 2), (2, 4)]) """ Explanation: Ejercicios Graphs, Paths & Components Ejercicios básicos de Grafos. Ejercicio - Número de Nodos y Enlaces _ (resuelva en código propio y usando la librería NetworkX (python) o iGraph (R)) _ Cuente el número de nodos y enlaces con los siguientes links (asum...
ajrichards/bayesian-examples
nlp/lda/data-munging.ipynb
bsd-3-clause
df = pd.read_csv('npr_articles.csv') """ Explanation: Read in Our Data The first step is to read out data into a pandas DataFrame. For an intro to using pandas I would highly suggest looking though this 10 minute guide to pandas. End of explanation """ df.head() """ Explanation: We can now checkout what our data c...
UDST/activitysim
activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb
bsd-3-clause
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating Mandatory Tour Frequency This notebook illustrates how to re-estimate a single model component for ActivitySim. This process includes running ActivitySim in estimation mode to read household...
jbpoline/cnv_analysis
CNV_dangerosite.ipynb
artistic-2.0
CWD = osp.join(osp.expanduser('~'), 'documents','grants_projects','roberto_projects', \ 'guillaume_huguet_CNV','File_OK') filename = 'Imagen_QC_CIA_MMAP_V2_Annotation.tsv' fullfname = osp.join(CWD, filename) arr = np.loadtxt(fullfname, dtype='str', comments=None, delimiter='\Tab', conv...
mintcloud/deep-learning
embeddings/Skip-Gram word2vec_theo.ipynb
mit
import time import numpy as np import tensorflow as tf import utils """ Explanation: Skip-gram word2vec In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p...
legacysurvey/rapala
notebooks/BASS2016-DetectorAnalysis.ipynb
bsd-3-clause
for ccdNum in [2,3]: exts = 4*(ccdNum-1) + arange(1,5) figure(figsize=(10,6)) for pnum,ext in enumerate(exts,start=1): subplot(2,2,pnum) for t,lbl,clr in zip([t15,t16],#,s15[b15],s16[b16],s15[o15],s16[o16]], ['2015','2016'],#,'2015b','2016b','2015o','2016o'], ...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/05_review/labs/4_preproc.ipynb
apache-2.0
#Ensure that we have Apache Beam version installed. !pip freeze | grep apache-beam || sudo pip install apache-beam[gcp]==2.12.0 import tensorflow as tf import apache_beam as beam import shutil import os print(tf.__version__) """ Explanation: Preprocessing Using Dataflow Learning Objectives - Creating datasets for Mac...
CalPolyPat/phys202-2015-work
assignments/assignment03/NumpyEx04.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns """ Explanation: Numpy Exercise 4 Imports End of explanation """ import networkx as nx K_5=nx.complete_graph(5) nx.draw(K_5) """ Explanation: Complete graph Laplacian In discrete mathematics a Graph is a set of vertices or n...
mromanello/SunoikisisDC_NER
participants_notebooks/Sunoikisis - Named Entity Extraction 1a-VV.ipynb
gpl-3.0
2 + 3 """ Explanation: Plan of the lecture Introduction: Information Extraction and Named Entity Recognition (NER) NER: definitions and tasks (extraction, classification, disambiguation) basic programming concepts in Python Doing NER with existing libraries: NER from Latin texts with CLTK NER from journal articles wi...
dbouquin/AstroHackWeek2015
day1/day1_numericalsummaries.ipynb
gpl-2.0
import os import requests # get some CSV data from the SDSS SQL server URL = "http://skyserver.sdss.org/dr12/en/tools/search/x_sql.aspx" cmd = """ SELECT TOP 10000 p.u, p.g, p.r, p.i, p.z, s.class, s.z, s.zerr FROM PhotoObj AS p JOIN SpecObj AS s ON s.bestobjid = p.objid WHERE p.u BETWEEN 0 AND 19.6 ...
iemejia/incubator-beam
examples/notebooks/get-started/try-apache-beam-java.ipynb
apache-2.0
# Run and print a shell command. def run(cmd): print('>> {}'.format(cmd)) !{cmd} # This is magic to run 'cmd' in the shell. print('') # Copy the input file into the local filesystem. run('mkdir -p data') run('gsutil cp gs://dataflow-samples/shakespeare/kinglear.txt data/') """ Explanation: <a href="https://col...
IBMDecisionOptimization/docplex-examples
examples/mp/jupyter/incremental_modeling.ipynb
apache-2.0
import sys try: import docplex.mp except: raise Exception('Please install docplex. See https://pypi.org/project/docplex/') """ Explanation: Incremental modeling with decision optimization This tutorial includes everything you need to set up decision optimization engines, build a mathematical programming model,...
jpn--/larch
larch/doc/example/202_exville_mc_logsums.ipynb
gpl-3.0
import larch, numpy, pandas, os from larch import P, X larch.__version__ """ Explanation: 202: Exampville Mode Choice Logsums Welcome to Exampville, the best simulated town in this here part of the internet! Exampville is a demonstration provided with Larch that walks through some of the data and tools that a transp...
matmodlab/matmodlab2
notebooks/GettingStarted.ipynb
bsd-3-clause
%pylab inline from matmodlab2 import * """ Explanation: Getting Started <a name='contents'></a> Contents <a href='#magic'>The <tt>matmodlab</tt> namespace</a> <a href='#model.def'>Defining a Model</a> <a href='#model.def.mat'>Material Model Definition</a> <a href='#model.def.step'>Step Definitions</a> <a href='#model...
astarostin/MachineLearningSpecializationCoursera
course4/week1 - Доверительные интервалы - quiz.ipynb
apache-2.0
import scipy.stats scipy.stats.norm.ppf(0.9985) """ Explanation: week1 - Доверительные интервалы - quiz 1. Давайте уточним правило трёх сигм. Утверждение: 99.7% вероятностной массы случайной величины X∼N(μ,σ2) лежит в интервале μ±c⋅σ. Чему равно точное значение константы c? Округлите ответ до четырёх знаков после дес...
terrydolan/prem
prem-analysis.ipynb
mit
import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import sys from itertools import cycle from collections import defaultdict from datetime import datetime from __future__ import division # enable inline plotting %matplotlib inline """ Explanation: English Premiership 201...
whitead/numerical_stats
unit_13/lectures/lecture_1.ipynb
gpl-3.0
%matplotlib inline import random import numpy as np import matplotlib.pyplot as plt from math import sqrt, pi, erf import seaborn seaborn.set_context("talk") import scipy.stats """ Explanation: Solving Ordinary Differential Equations Unit 13, Lecture 1 Numerical Methods and Statistics Prof. Andrew White, April 24 201...
StuartLittlefair/reducer
reducer/reducer-template.ipynb
bsd-3-clause
from __future__ import division %matplotlib inline import numpy as np import reducer.gui import reducer.astro_gui as astro_gui from reducer.image_browser import ImageBrowser import msumastro from reducer import __version__ print __version__ """ Explanation: Reducer: (Put your name here) Reviewer: (Put your name he...
ES-DOC/esdoc-jupyterhub
notebooks/bnu/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: BNU Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Concent...
chemo-wakate/tutorial-6th
beginner/mario/overlook.ipynb
mit
# 数値計算やデータフレーム操作に関するライブラリをインポートする import numpy as np import pandas as pd # URL によるリソースへのアクセスを提供するライブラリをインポートする。 # import urllib # Python 2 の場合 import urllib.request # Python 3 の場合 # 図やグラフを図示するためのライブラリをインポートする。 %matplotlib inline import matplotlib.pyplot as plt import matplotlib.ticker as ticker from matplotlib.colors...