repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
bjshaw/phys202-2015-work
assignments/assignment02/ProjectEuler6.ipynb
mit
lst = range(101) """ Explanation: Project Euler: Problem 6 https://projecteuler.net/problem=6 The sum of the squares of the first ten natural numbers is, $$1^2 + 2^2 + ... + 10^2 = 385$$ The square of the sum of the first ten natural numbers is, $$(1 + 2 + ... + 10)^2 = 552 = 3025$$ Hence the difference between the su...
manifoldai/merf
notebooks/Real World MERF Examples.ipynb
mit
sleep_df = pd.read_csv('../data/sleepstudy.csv') fig, ax = plt.subplots(figsize=(15,12)) for label, group in sleep_df.groupby('Subject'): group.plot(x='Days', y='Reaction', ax=ax, label=label) plt.legend() plt.grid('on') plt.ylabel('Reaction') sleep_df.head() train, test = train_test_split(sleep_df, test_size=0....
mryab/askme
L2 - Nets.ipynb
mit
import numpy as np from sklearn.model_selection import train_test_split import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from __future__ import print_function from keras.datasets import mnist from keras.models import Sequential, Model from keras.layers.co...
alexandrnikitin/workshops
automated-feature-engineering-selection/notebooks/4-feature-selection.ipynb
mit
import numpy as np import pandas as pd from IPython.display import Image """ Explanation: Automated feature selection Reasons to have: Some automatically created features are garbage Reduces complexity Trains faster Improves accuracy Reduce overfitting Methods: 1. Filter methods 2. Wrapper Methods 3. Embedded Metho...
ES-DOC/esdoc-jupyterhub
notebooks/cccma/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', 'cccma', 'sandbox-2', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: CCCMA Source ID: SANDBOX-2 Topic: Aerosol Sub-Topics: Transport, Emissions, Con...
superbobry/pymc3
pymc3/examples/posterior_predictive.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 %matplotlib inline import numpy as np import pymc3 as pm import seaborn as sns import matplotlib.pyplot as plt from collections import defaultdict """ Explanation: Posterior Predictive Checks in PyMC3 PPCs are a great way to validate a model. The idea is to generate data sets from t...
Heerozh/deep-learning
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
facaiy/book_notes
machine_learning/logistic_regression/demo.ipynb
cc0-1.0
names = [("x", k) for k in range(8)] + [("y", 8)] df = pd.read_csv("./res/dataset/pima-indians-diabetes.data", names=names) df.head(3) """ Explanation: 逻辑回归算法简介和Python实现 0. 实验数据 End of explanation """ x = np.linspace(-1.5, 1.5, 1000) y1 = 0.5 * x + 0.5 y2 = sp.special.expit(5 * x) pd.DataFrame({'linear': y1, 'logi...
lamahechag/clubes_de_ciencia
Dia_1_monitor/.ipynb_checkpoints/Dia_1-checkpoint.ipynb
mit
2+3 """ Explanation: Opreaciones Matematicas Suma : $2+3$ End of explanation """ 2*3 """ Explanation: Multiplicación: $2x3$ End of explanation """ 2/3 """ Explanation: División: $\frac{2}{3}$ End of explanation """ 2**3 """ Explanation: Potencia: $ 2^{3}$ End of explanation """ # Importar una libreria en Py...
daniel-severo/dask-ml
docs/source/examples/hyperparameter-search.ipynb
bsd-3-clause
%matplotlib inline import numpy as np from time import time from scipy.stats import randint as sp_randint from scipy import stats from distributed import Client import distributed.joblib from sklearn.externals import joblib from sklearn.datasets import load_digits from sklearn.linear_model import LogisticRegression...
AlekseyLobanov/gotohack
Analysis-1.ipynb
mit
import pymongo, json, matplotlib client2 = pymongo.MongoClient('goto.reproducible.work') pazans = json.loads(open('/home/oleg/coding/go-to-hack-main/share/pazan_publs.json').read()) users = {} st = set() for s in pazans.items(): st.add(s[0]) for l in open('/home/oleg/coding/go-to-hack-main/share/source_data/users.j...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NERC Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balan...
tensorflow/docs-l10n
site/ko/tutorials/estimator/premade.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...
RafaelNH/Free-water-elimination-DTI
notebook/supplementary_notebook_4.ipynb
bsd-3-clause
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import time %matplotlib inline # Import Dipy's procedures to process diffusion tensor import dipy.reconst.dti as dti # Import Dipy's functions that load and read CENIR data from dipy.data import fetch_cenir_multib from dipy.data ...
ES-DOC/esdoc-jupyterhub
notebooks/nuist/cmip6/models/sandbox-3/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-3', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: NUIST Source ID: SANDBOX-3 Topic: Ocean Sub-Topics: Timestepping Framework, Advecti...
zakandrewking/cobrapy
documentation_builder/deletions.ipynb
lgpl-2.1
import pandas from time import time import cobra.test from cobra.flux_analysis import ( single_gene_deletion, single_reaction_deletion, double_gene_deletion, double_reaction_deletion) cobra_model = cobra.test.create_test_model("textbook") ecoli_model = cobra.test.create_test_model("ecoli") """ Explanation: S...
tensorflow/docs-l10n
site/zh-cn/addons/tutorials/tqdm_progress_bar.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...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/ml_metadata/sdk-metric-parameter-tracking-for-locally-trained-models.ipynb
apache-2.0
import sys if "google.colab" in sys.modules: USER_FLAG = "" else: USER_FLAG = "--user" ! pip3 install -U tensorflow==2.8 $USER_FLAG ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: <table align="left"> <td> <a href="https://colab.research.google.com/github/GoogleCloudPlatfo...
zerothi/sisl
docs/visualization/viz_module/showcase/WavefunctionPlot.ipynb
mpl-2.0
import sisl import sisl.viz """ Explanation: WavefunctionPlot The WavefunctionPlot class will help you very easily generate and display wavefunctions from a Hamiltonian or any other source. If you already have your wavefunction in a grid, you can use GridPlot. <div class="alert alert-info"> Note `WavefunctionPlot`...
gengyj/ml-basic-course
tensorflow_captcha_simple.ipynb
gpl-3.0
import time import os from multiprocessing import Pool from captcha.image import ImageCaptcha import numpy as np import skimage.io as io import tensorflow as tf import matplotlib.pylab as plt %matplotlib inline """ Explanation: 验证码识别 简单版本 End of explanation """ IMG_H = 64 IMG_W = 160 IMG_CHANNALS = 1 CAPTCHA_SIZE ...
nikbearbrown/Deep_Learning
NEU/Sai_Raghuram_Kothapalli_DL/CIFAR_10-Keras.ipynb
mit
# Plot ad hoc CIFAR10 instances from keras.datasets import cifar10 from matplotlib import pyplot # load data (X_train, y_train), (X_test, y_test) = cifar10.load_data() """ Explanation: Object recognition with CNN Keras is a Python library for deep learning that wraps the powerful numerical libraries Theano and Tensor...
MissouriDSA/twitter-locale
twitter/twitter_1.ipynb
mit
import psycopg2 import pandas as pd # define our query statement = """SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name = 'tweet';""" try: connect_str = "dbname='twitter' user='dsa_ro_user' host='dbase.dsa.missouri.edu'password='readonly'" # use our connection...
tensorflow/workshops
tfx_airflow/notebooks/step3.ipynb
apache-2.0
from __future__ import print_function !pip install -q papermill !pip install -q matplotlib !pip install -q networkx import os import tfx_utils import tensorflow as tf %matplotlib notebook tf.get_logger().propagate = False def _make_default_sqlite_uri(pipeline_name): return os.path.join(os.environ['HOME'], 'airfl...
bartleyn/tpot
tutorials/Titanic_Kaggle.ipynb
gpl-3.0
# Import required libraries from tpot import TPOT from sklearn.cross_validation import train_test_split import pandas as pd import numpy as np # Load the data titanic = pd.read_csv('data/titanic_train.csv') titanic.head(5) """ Explanation: TPOT tutorial on the Titanic dataset The Titanic machine learning competition...
retnuh/deep-learning
intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
n-witt/MachineLearningWithText_SS2017
tutorials/0 Python basics 1.ipynb
gpl-3.0
from IPython.display import Image Image('images/mem0.jpg') Image('images/mem1.jpg') Image('images/C++_machine_learning.png') Image('images/Java_machine_learning.png') Image('images/Python_machine_learning.png') Image('images/R_machine_learning.png') """ Explanation: Note: We are using Python here, not Python 2. T...
aschaffn/phys202-2015-work
assignments/assignment09/IntegrationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy import integrate """ Explanation: Integration Exercise 1 Imports End of explanation """ def trapz(f, a, b, N): """Integrate the function f(x) over the range [a,b] with N points.""" x = np.linspace(a,b,N+1) h = np.diff(x)[1] ...
ES-DOC/esdoc-jupyterhub
notebooks/bcc/cmip6/models/sandbox-3/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-3', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: BCC Source ID: SANDBOX-3 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radiat...
jsnajder/MachineLearningTutorial
Machine Learning Tutorial.ipynb
cc0-1.0
import scipy as sp import scipy.stats as stats import matplotlib.pyplot as plt from numpy.random import normal from SU import * %pylab inline """ Explanation: Basics of Machine Learning Tutorial held at University of Zurich, 23-24 March 2016 (c) 2016 Jan Šnajder (&#106;&#97;&#110;&#46;&#115;&#110;&#97;&#106;&#100;&#10...
atulsingh0/MachineLearning
python_DC/IntoductionToDataBase_#1.5.ipynb
gpl-3.0
# Import create_engine, MetaData from sqlalchemy import create_engine , MetaData # Define an engine to connect to chapter5.sqlite: engine engine = create_engine('sqlite:///chapter5.sqlite') # Initialize MetaData: metadata metadata = MetaData() """ Explanation: Case Study Import create_engine and MetaData from sqlalc...
jotterbach/Data-Exploration-and-Numerical-Experimentation
Numerical-Experimentation/t-SNE and the KL Divergence.ipynb
cc0-1.0
import pymc import seaborn as sns import scipy.stats as stats import numpy as np import matplotlib.pyplot as plt %matplotlib inline def calculate_single_kl_value(p, q): return p * (np.log(p) - np.log(q)) def single_bernoulli_draw(p, n_bern): bernoulli = pymc.Bernoulli('bern', p, size = n_bern) return flo...
AC209ConsumerConfidence/AC209ConsumerConfidence.github.io
Applying SentiWordNet to News Data.ipynb
gpl-3.0
DATA_DIR = "./data/" all_data_list = [] for year in range(1990,2017): data = pd.read_csv(DATA_DIR + '{}_Output.csv'.format(year), header=None, encoding="utf-8") all_data_list.append(data) # list of dataframes data = pd.concat(all_data_list, axis=0) data.columns = ['id','date','headline', 'lead'] # Drop dupes ...
mne-tools/mne-tools.github.io
0.21/_downloads/78dfec6019dc9e7214e1efd97200f1c4/plot_10_overview.ipynb
bsd-3-clause
import os import numpy as np import mne """ Explanation: Overview of MEG/EEG analysis with MNE-Python This tutorial covers the basic EEG/MEG pipeline for event-related analysis: loading data, epoching, averaging, plotting, and estimating cortical activity from sensor data. It introduces the core MNE-Python data struct...
Luke035/dlnd-lessons
batch-norm/Batch_Normalization_Lesson.ipynb
mit
# Import necessary packages import tensorflow as tf import tqdm import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Import MNIST data so we have something for our experiments from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) "...
yangw1234/BigDL
apps/variational-autoencoder/using_variational_autoencoder_and_deep_feature_loss_to_generate_faces.ipynb
apache-2.0
from bigdl.dllib.nn.layer import * from bigdl.dllib.nn.criterion import * from bigdl.dllib.optim.optimizer import * from bigdl.dllib.feature.dataset import mnist import datetime as dt from glob import glob import os import numpy as np from utils import * import imageio image_size = 148 Z_DIM = 100 ENCODER_FILTER_NUM =...
tatjanus/cianparser
cian_dataprep_visualization.ipynb
bsd-2-clause
import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sns plt.style.use('bmh') %matplotlib inline import random random.seed(42) np.random.seed(42) districts = {1: 'NW', 4: 'C', 5:'N', 6:'NE', 7:'E', 8:'SE', 9:'S', 10:'SW', 11:'W'} data = pd.read_csv('cian_full_data.csv') dat...
datahac/jup
candidates results/Bugrov_test.ipynb
apache-2.0
path = 'task_data/Sessions_Page.json' path2 = 'task_data/Goal1CompletionLocation_Goal1Completions.json' with open(path, 'r') as f: sessions_page = json.loads(f.read()) with open(path2, 'r') as f: goals_page = json.loads(f.read()) """ Explanation: .загружаем файлы .json End of explanation """ type (sessions...
jbwhit/jupyter-best-practices
notebooks/08-More_basics.ipynb
mit
names = ['alice', 'jonathan', 'bobby'] ages = [24, 32, 45] ranks = ['kinda cool', 'really cool', 'insanely cool'] for (name, age, rank) in zip(names, ages, ranks): print(name, age, rank) for index, (name, age, rank) in enumerate(zip(names, ages, ranks)): print(index, name, age, rank) # return, esc, shift+ent...
hparik11/Deep-Learning-Nanodegree-Foundation-Repository
gan_mnist/.ipynb_checkpoints/Intro_to_GANs_Solution-checkpoint.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...
jotterbach/Data-Exploration-and-Numerical-Experimentation
Numerical-Experimentation/The Monty Hall Problem.ipynb
cc0-1.0
import matplotlib import matplotlib.pyplot as plt import random as rd import numpy as np from numpy.random import choice %matplotlib inline matplotlib.style.use('ggplot') matplotlib.rc_params_from_file("../styles/matplotlibrc" ).update() """ Explanation: The Monty Hall Problem Introduction Thinking conditionally is a...
AbstractGeek/rusmalai-ncbs
02-perceptron-learning-and-backpropagation.ipynb
mit
# Import libraries %matplotlib inline from sklearn import datasets import matplotlib.pyplot as plt import numpy as np from copy import deepcopy """ Explanation: Back propagation algorithm Perceptron learning algorithm (Recap) <img src="imgs/perceptron.png"> Output is simply: $$ y(x) = \mathbf{w^Tx} $$ The classifying ...
NYUDataBootcamp/Projects
UG_S16/Webb-HealthcareSystems.ipynb
mit
#Import pandas & matplotlib Tools %matplotlib inline import pandas as pd import pandas_datareader.data as web from pandas_datareader import wb import matplotlib as mpl import matplotlib.pyplot as plt #Download necessary data from World Bank #Private health spending as a percentage of GDP df1 = wb.download(indicator='...
davebshow/DH3501
class15.ipynb
mit
# This sets up the "cell magic" used by ipython-cypher %load_ext cypher %matplotlib inline import networkx as nx import matplotlib.pyplot as plt %%cypher // Cypher comments use two slashes // A really useful query that clears the database MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n, r """ Explanation: <div align="le...
danielgoncalvesti/BIGDATA2017
Atividade02/Lab/Lab3_AnaliseExploratoria.ipynb
gpl-3.0
sc = SparkContext.getOrCreate() import os import numpy as np filename = os.path.join("Data","Aula03","train.csv") CrimeRDD = sc.textFile(filename,8) header = CrimeRDD.take(1)[0] # o cabeçalho é a primeira linha do arquivo print "Campos disponíveis: {}".format(header) """ Explanation: Análise Exploratória Esse note...
AEW2015/PYNQ_PR_Overlay
Pynq-Z1/notebooks/Video_PR/GrayScale_Filter.ipynb
bsd-3-clause
from pynq.drivers.video import HDMI from pynq import Bitstream_Part from pynq.board import Register from pynq import Overlay Overlay("demo.bit").download() """ Explanation: Don't forget to delete the hdmi_out and hdmi_in when finished Grayscale Filter Example In this notebook, we will explore the averaging of RGB val...
MingChen0919/learning-apache-spark
notebooks/03-data-preparation/stringindexer-and-onehotencoder.ipynb
mit
import pandas as pd pdf = pd.DataFrame({ 'x1': ['a','a','b','b', 'b', 'c'], 'x2': ['apple', 'orange', 'orange','orange', 'peach', 'peach'], 'x3': [1, 1, 2, 2, 2, 4], 'x4': [2.4, 2.5, 3.5, 1.4, 2.1,1.5], 'y1': [1, 0, 1, 0, 0, 1], 'y2': ['yes', 'no', 'no', 'yes', 'yes', 'ye...
parrt/msan501
notes/dataframes.ipynb
mit
import pandas as pd df = pd.read_csv("data/rent.csv", parse_dates=['created']) df.head(2) df.head(2).T """ Explanation: Sniffing data frames We're going to use a real kaggle competition data set to explore Pandas dataframes. Grab the rent.csv.zip file and unzip it. End of explanation """ df.info() df.describe() d...
MissouriDSA/twitter-locale
twitter/twitter_3.ipynb
mit
# BE SURE TO RUN THIS CELL BEFORE ANY OF THE OTHER CELLS import psycopg2 import pandas as pd # put your code here # ------------------ statement = """ SELECT DISTINCT iso_language, job_id,COUNT(*) FROM (SELECT DISTINCT ON (from_user, iso_language) * FROM (SELECT * FROM twitter.tweet WHERE iso_language != 'und' A...
Naereen/notebooks
simus/Simulations_du_jeu_de_151.ipynb
mit
import numpy as np import numpy.random as rn rn.seed(0) # Pour obtenir les mêmes résultats import matplotlib.pyplot as plt import seaborn as sns sns.set(context="notebook", style="darkgrid", palette="hls", font="sans-serif", font_scale=1.4) """ Explanation: Simulons le jeu de 151 avec Python ! But : Simuler numériq...
NYUDataBootcamp/Materials
Code/notebooks/bootcamp_pandas_adv4-merge-extended.ipynb
mit
%matplotlib inline import pandas as pd # data package import matplotlib.pyplot as plt # graphics import datetime as dt # date tools, used to note current date # these are new import os # operating system tools (check files) import requests, io # internet an...
tensorflow/tfx
docs/tutorials/tfx/penguin_simple.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...
harish-garg/Data-Analysis
udacity_intro_data_analysis/udacity_student_data/L1_Starter_Code.ipynb
gpl-3.0
import unicodecsv ## Longer version of code (replaced with shorter, equivalent version below) # enrollments = [] # f = open('enrollments.csv', 'rb') # reader = unicodecsv.DictReader(f) # for row in reader: # enrollments.append(row) # f.close() def read_csv(filename): with open(filename, 'rb') as f: re...
coolharsh55/advent-of-code
2016/python3/Day02.ipynb
mit
def numpad_number_from_point(point): return str(point.y * 3 + point.x + 1) """ Explanation: Day 2: Bathroom Security author: Harshvardhan Pandit license: MIT link to problem statement You arrive at Easter Bunny Headquarters under cover of darkness. However, you left in such a rush that you forgot to use the bathro...
oasis-open/cti-python-stix2
docs/guide/datastore.ipynb
bsd-3-clause
from taxii2client import Collection from stix2 import CompositeDataSource, FileSystemSource, TAXIICollectionSource # create FileSystemStore fs = FileSystemSource("/tmp/stix2_source") # create TAXIICollectionSource colxn = Collection('http://127.0.0.1:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/'...
ucsc-astro/coffee
16_02_03_intro_to_pandas/intro_to_pandas.ipynb
gpl-3.0
url = "https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/master/csv/ggplot2/diamonds.csv" data = np.genfromtxt(url, delimiter=",", dtype=None, names=True) data """ Explanation: What is Pandas? Pandas provides fast, flexible, and expressive data structures designed to make working with “relational” or “la...
dataewan/deep-learning
gan_mnist/Intro_to_GANs_Exercises.ipynb
mit
%matplotlib inline import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
scotthuang1989/Python-3-Module-of-the-Week
text/text_wrap.ipynb
apache-2.0
import textwrap """ Explanation: The textwrap module can be used to format text for output in situations where pretty-printing is desired. It offers programmatic functionality similar to the paragraph wrapping or filling features found in many text editors and word processors. End of explanation """ sample_text = ''...
adrn/tutorials
notebooks/units-and-integration/units-and-integration.ipynb
cc0-1.0
import numpy as np from scipy import integrate from astropy.modeling.blackbody import blackbody_lambda, blackbody_nu, BlackBody1D from astropy import units as u, constants as c import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Using scipy.integrate Authors Zach Pace, Lia Corrales, Stephanie T. Dougl...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160531화_10일차_Scikit-Learn & statsmodels 패키지 소개 Introduction to Scikit-Learn & statsmodels packages/3.Scikit-Learn 패키지의 샘플 데이터 - 회귀 분석용.ipynb
mit
from sklearn.datasets import load_boston boston = load_boston() print(boston.DESCR) dfX = pd.DataFrame(boston.data, columns=boston.feature_names) dfy = pd.DataFrame(boston.target, columns=["MEDV"]) df = pd.concat([dfX, dfy], axis=1) df.tail() df.describe() cols = ["LSTAT", "NOX", "RM", "MEDV"] sns.pairplot(df[cols])...
hainm/scikit-xray-examples
demos/speckle/X-ray_Speckle_Visibility_Spectroscopy.ipynb
bsd-3-clause
import xray_vision import xray_vision.mpl_plotting as mpl_plot import skxray.core.speckle as xsvs import skxray.core.roi as roi import skxray.core.correlation as corr import skxray.core.utils as utils import numpy as np import os, sys import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker im...
Bio204-class/bio204-notebooks
Introduction-to-Pandas.ipynb
cc0-1.0
import numpy as np import pandas as pd """ Explanation: A Quick Introduction to Pandas Author: Paul M. Magwene End of explanation """ np.random.seed(482010) # seed the pseudo-random number generators x = np.random.random(15) y = np.random.binomial(10, x) df = pd.DataFrame() df['prob'] = x df['count'] = y df.head()...
NekuSakuraba/my_capstone_research
subjects/em/Expectation Maximization.ipynb
mit
from scipy.interpolate import interp1d """ Explanation: https://stackoverflow.com/questions/11808074/what-is-an-intuitive-explanation-of-the-expectation-maximization-technique End of explanation """ import numpy as np from scipy import stats import matplotlib.pyplot as plt def estimate_mean(data, weight): retur...
ecabreragranado/OpticaFisicaII
TratamientoAntirreflejante/Tratamiento_Antirreflejante_Ejercicio.ipynb
gpl-3.0
# NO TOCAR. SOLO EJECUTAR (SOLO UNA VEZ) #################################################################################### %pylab inline lambda0 = int(np.random.rand()*150 +475) print "Longitud de onda para la que optimizamos el tratamiento = ",lambda0, " nm" """ Explanation: Diseño y caracterización de un tratamie...
ipython/ipywidgets
docs/source/examples/Output Widget.ipynb
bsd-3-clause
import ipywidgets as widgets """ Explanation: Index - Back - Next Output widgets: leveraging Jupyter's display system End of explanation """ out = widgets.Output(layout={'border': '1px solid black'}) out """ Explanation: The Output widget can capture and display stdout, stderr and rich output generated by IPython. ...
tzoiker/gensim
docs/notebooks/Word2Vec_FastText_Comparison.ipynb
lgpl-2.1
import nltk nltk.download('brown') # Only the brown corpus is needed in case you don't have it. # Generate brown corpus text file with open('brown_corp.txt', 'w+') as f: for word in nltk.corpus.brown.words(): f.write('{word} '.format(word=word)) # Make sure you set FT_HOME to your fastText directory root...
kitu2007/dl_class
weight-initialization/weight_initialization.ipynb
mit
%matplotlib inline import tensorflow as tf import helper from tensorflow.examples.tutorials.mnist import input_data print('Getting MNIST Dataset...') mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) print('Data Extracted.') """ Explanation: Weight Initialization In this lesson, you'll learn how to fin...
KshitijT/fundamentals_of_interferometry
1_Radio_Science/1_8_astronomical_radio_sources.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Outline Glossary 1. Radio Science using Interferometric Arrays Previous: 1.7 Line emission Next: 1.9 A brief introduction to interferometry Section...
ohbm/brain-hacking-101
beginner-python/001-arrays.ipynb
apache-2.0
import numpy as np # Numpy is a package. To see what's in a package, type the name, a period, then hit tab #np? #np. # Some examples of numpy functions and "things": print(np.sqrt(4)) print(np.pi) # Not a function, just a variable print(np.sin(np.pi)) # A function on a variable :) """ Explanation: Brain-hacking 10...
stscieisenhamer/stginga
stginga/examples/ginga_nbinteract.ipynb
bsd-3-clause
webbrowser.open(server.get_viewer_urls()['Main Viewer']) """ Explanation: The next cell will open a new window with the same view as above End of explanation """ f = fits.open('https://archive.stsci.edu/pub/hlsp/angst/acs/hlsp_angst_hst_acs-wfc_10210-ugc8760_f814w_v1_ref.fits') server.load_fits(f) """ Explanation: ...
OlafLee/matplotlib-gallery
ipynb/barplots.ipynb
gpl-3.0
%load_ext watermark %watermark -u -v -d -p matplotlib,numpy """ Explanation: Sebastian Raschka back to the matplotlib-gallery at https://github.com/rasbt/matplotlib-gallery End of explanation """ %matplotlib inline """ Explanation: <font size="1.5em">More info about the %watermark extension</font> End of explanati...
JamesSample/icpw
toc_report_feb_2019_part6.ipynb
mit
# Read stations stn_path = r'../../../all_icpw_sites_may_2019.xlsx' stn_df = pd.read_excel(stn_path, sheet_name='all_icpw_stns') stn_df.head() nivapy.spatial.quickmap(stn_df, cluster=True, popup='station_code') """ Explanation: TOC Thematic Report - February 2019 (Part ...
google/jax
docs/notebooks/thinking_in_jax.ipynb
apache-2.0
import matplotlib.pyplot as plt import numpy as np x_np = np.linspace(0, 10, 1000) y_np = 2 * np.sin(x_np) * np.cos(x_np) plt.plot(x_np, y_np); import jax.numpy as jnp x_jnp = jnp.linspace(0, 10, 1000) y_jnp = 2 * jnp.sin(x_jnp) * jnp.cos(x_jnp) plt.plot(x_jnp, y_jnp); """ Explanation: How to Think in JAX JAX prov...
metpy/MetPy
v0.10/_downloads/52c3e3d710569bed83f26e14e23bb356/Inverse_Distance_Verification.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np from scipy.spatial import cKDTree from scipy.spatial.distance import cdist from metpy.interpolate.geometry import dist_2 from metpy.interpolate.points import barnes_point, cressman_point from metpy.interpolate.tools import calc_kappa def draw_circle(ax, x, y, r, m, ...
kylemede/DS-ML-sandbox
KaggelChallenges/titanic/.ipynb_checkpoints/explore-checkpoint.ipynb
gpl-3.0
import pandas as pd from pandas import Series, DataFrame import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set_style("whitegrid") train_df = pd.read_csv("train.csv",dtype={"Age":np.float64},) train_df.head() # find how many ages train_df['Age'].count() # how many ages ...
jaganadhg/data_science_notebooks
WiPBDSCwR/CH4.ipynb
bsd-3-clause
%matplotlib inline from matplotlib import pylab as plt plt.rcParams['figure.figsize'] = (15.0, 10.0) import pandas as pd import seaborn as sns """ Explanation: Chapter 4 Data Visualization End of explanation """ data = pd.read_csv("978-3-319-12065-2/chapter-4/teams.csv") data.head() """ Explanation: 4.1 Introductio...
tensorflow/docs-l10n
site/zh-cn/guide/mixed_precision.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...
4dsolutions/Python5
Polyhedrons 101.ipynb
mit
import sqlite3 as sql import os from pprint import pprint class DB: backend = 'sqlite3' # default target_path = os.getcwd() # current directory db_name = ":file:" # lets work directly with a file db_name = os.path.join(target_path, 'shapes_lib.db') @classmethod def connect(cls)...
liganega/Gongsu-DataSci
previous/notes2017/W04/GongSu08_Lists.ipynb
gpl-3.0
record_f = open("Sample_Data/Swim_Records/record_list.txt") record = record_f.read().decode('utf-8').split('\n') record_f.close() for line in record: print(line) """ Explanation: 리스트 활용 주요 내용 파이썬에 내장되어 있는 컬렉션 자료형 중의 하나인 리스트(list)에 대해 알아본다. 리스트(lists): 파이썬에서 사용할 수 있는 임의의 값들을 모아서 하나의 값으로 취급하는 자료형 사용 형태: 대괄호 사용 e...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/09_preparing_for_sirajs_lesson/notebooks/02_intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
vipmunot/Data-Science-Course
Data Visualization/Lab 12/w12_lab_Vipul_Munot.ipynb
mit
import pandas as pd from urllib.request import urlopen import json import warnings warnings.filterwarnings("ignore") """ Explanation: W12 lab assignment End of explanation """ pokemon = pd.read_csv('pokemon.csv') pokemon.head() """ Explanation: Choropleth map Let's make a choropleth map with Pokemon statistics. The...
DawesLab/LabNotebooks
Cloud Chamber Test Analysis.ipynb
mit
#SG Here is the cloud chamber data collected of brightness vs. time when the brightness of a laser #incident on the cloud chamber is without any added mist for 5 seconds, then 5 seconds of mist. plt.plot(cloud_data[1:,0],cloud_data[1:,1]) plt.plot(cloud_data[1:,0],cloud_data[1:,3]) plt.plot(cloud_data[1:,0],cloud_dat...
neuroidss/nupic.research
projects/modules_math/Grid_Cell_Modules_Math.ipynb
agpl-3.0
# n = number of cells per module # m = number of modules # theta = number of matching modules needed to call two representations equal # t = exact match threshold used as an intermediate variable # U = number of representations in union # s = number of subsampled bits, or the number of synapses that a segment receives ...
CorySimon/pyIAST
ternary_example/ternary_adsorption_example.ipynb
mit
df_N2 = pd.read_csv("N2.csv", skiprows=1) N2_isotherm = pyiast.ModelIsotherm(df_N2, loading_key="Loading(mmol/g)", pressure_key="P(bar)", model='Henry') pyiast.plot_isotherm(N2_isotherm) N2_isotherm.print_params() df_CO2 = pd.read_csv("CO2.csv", skiprows=1) CO2_isotherm = pyia...
openradar/AMS-Short-Course-on-Open-Source-Radar-Software
9b_PyTDA_Demo-AMS_OSRSC.ipynb
bsd-2-clause
from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt import os import glob import pyart import pytda %matplotlib inline """ Explanation: PyTDA Demo <b>Author</b><br> Timothy Lang, NASA MSFC<br> timothy.j.lang@nasa.gov <b>Overview</b><br> PyTDA is a Python module that allow...
dsg-bielefeld/pentoref
code/ipython_notebooks/PentoRef_Exploration_sqlite_databases_1.ipynb
gpl-3.0
import sys sys.path.append("../python/") import pentoref.IO as IO import sqlite3 as sqlite # Create databases if required if False: # make True if you need to create the databases from the derived data for corpus_name in ["TAKE", "TAKECV", "PENTOCV"]: data_dir = "../../../pentoref/{0}_PENTOREF".format(co...
BeyondTheClouds/enoslib
docs/jupyter/00_setup_and_basics.ipynb
gpl-3.0
import enoslib as en """ Explanation: Setup and basic objects Get started with EnOSlib on Grid'5000. Website: https://discovery.gitlabpages.inria.fr/enoslib/index.html Instant chat: https://framateam.org/enoslib Source code: https://gitlab.inria.fr/discovery/enoslib This is the first notebooks of a series that wil...
tensorflow/docs-l10n
site/ja/agents/tutorials/4_drivers_tutorial.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...
lit-mod-viz/middlemarch-critical-histories
notebooks/anthologies-analysis.ipynb
gpl-3.0
import spacy import pandas as pd %matplotlib inline from ast import literal_eval import numpy as np import re import json from nltk.corpus import names from collections import Counter from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [16, 6] plt.style.use('ggplot') nlp = spacy.load('en') with open...
Ykharo/notebooks
C elemental, querido Cython..ipynb
bsd-2-clause
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Cython, que no CPython No, no nos hemos equivocado en el título, hoy vamos a hablar de Cython. ¿Qué es Cython? Cython son dos cosas: Por una parte, Cython es un lenguaje de programación (un superconjunto de Python) que une Python c...
CrowdTruth/CrowdTruth-core
tutorial/notebooks/Free Input Task - Person Annotation in Video.ipynb
apache-2.0
import pandas as pd test_data = pd.read_csv("../data/person-video-free-input.csv") test_data.head() """ Explanation: CrowdTruth for Free Input Tasks: Person Annotation in Video In this tutorial, we will apply CrowdTruth metrics to a free input crowdsourcing task for Person Annotation from video fragments. The workers...
google/trax
trax/models/reformer/text_generation.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 Licen...
mroberge/hydrofunctions
docs/notebooks/Graphing.ipynb
mit
import hydrofunctions as hf import pandas as pd %matplotlib inline hf.__version__ pd.__version__ """ Explanation: Example Plots This notebook illustrates the different types of graph you can produce with Hydrofunctions. We have: hydrograph flow duration cycleplot histogram We'll start with the usual imports: End of ...
Cyb3rWard0g/ThreatHunter-Playbook
docs/notebooks/windows/05_defense_evasion/WIN-191224222300.ipynb
gpl-3.0
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Extended NetNTLM Downgrade Metadata | | | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/12/24 | | modification date | 2020/09/20 | | playbook related | [] | Hyp...
tzoiker/gensim
docs/notebooks/annoytutorial.ipynb
lgpl-2.1
# Load the model import gensim, os from gensim.models.word2vec import Word2Vec # Set file names for train and test data test_data_dir = '{}'.format(os.sep).join([gensim.__path__[0], 'test', 'test_data']) + os.sep lee_train_file = test_data_dir + 'lee_background.cor' class MyText(object): def __iter__(self): ...
dandtaylor/MetroShare
Analysis.ipynb
mit
import pickle import pandas as pd from datetime import datetime, timedelta import matplotlib.pyplot as plt import matplotlib matplotlib.style.use('ggplot') %matplotlib inline print(plt.style.available) metro_delays = pickle.load( open( "metro_delays.p", "rb" ) ) bikeshare_rides = pickle.load( open( "bikeshare_rides.p...
jakdot/pyactr
docs/Getting started I.ipynb
gpl-3.0
import pyactr as actr playing_memory = actr.ACTRModel() """ Explanation: Getting started I We will explain basics of ACT-R and pyactr on several very simple models/minds that play Memory. Model 1 - introduction to the goal buffer and production rules The first model will be a mind that makes just one action - it will...
graphistry/pygraphistry
demos/demos_databases_apis/alienvault/OTXLockerGoga.ipynb
bsd-3-clause
#!pip install graphistry -q #!pip install OTXv2 -q import graphistry import pandas as pd from OTXv2 import OTXv2, IndicatorTypes from gotx import G_OTX # To specify Graphistry account & server, use: # graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com') # For more...
ESGF/esgf-pyclient
notebooks/examples/download.ipynb
bsd-3-clause
from pyesgf.logon import LogonManager lm = LogonManager() lm.logoff() lm.is_logged_on() myproxy_host = 'esgf-data.dkrz.de' lm.logon(username=None, password=None, hostname=myproxy_host) lm.is_logged_on() """ Explanation: Examples of pyesgf download usage Obtain MyProxy credentials to allow downloading files: End of ex...
amorgun/shad-ml-notebooks
notebooks/s1-4/linear.ipynb
unlicense
def get_grid(data, step=0.1): x_min, x_max = data.x.min() - 1, data.x.max() + 1 y_min, y_max = data.y.min() - 1, data.y.max() + 1 return np.meshgrid(np.arange(x_min, x_max, step), np.arange(y_min, y_max, step)) from sklearn.cross_validation import cross_val_score def get_score(X, y,...
ucsdlib/python-novice-inflammation
2-loops.ipynb
cc0-1.0
#example task: print each character in a word #one way to do is use a series of print statements word = 'lead' print(word[0]) print(word[1]) print(word[2]) print(word[3]) """ Explanation: last lesson we wrote code to plot some values from our inflammation data. but we have a dozen we want to do same for how to repeat...