repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
a-pagano/BigDive5
DataScience/Essai_PySpark.ipynb
mit
wre = re.compile('\w') print wre.sub('', 'This. Is, 22 A Text{}') notwre = re.compile('[^\w]') print notwre.sub('', 'This. Is, 22 A Text{}') notwre = re.compile('([^\w\s]|\d+)') print notwre.sub('', 'This. Is, 22 A Text{}').lower() text.map(lambda line: line.replace('--', ' ').lower()) \ .flatMap(lambda line: line...
farfan92/SpringBoard-
data_wrangling_xml/chrisfarfan_xml_exercise.ipynb
mit
document = ET.parse( './data/mondial_database.xml' ) import pandas as pd root = document.getroot() """ Explanation: XML exercise Using data in 'data/mondial_database.xml', the examples above, and refering to https://docs.python.org/2.7/library/xml.etree.elementtree.html, find 10 countries with the lowest infant mor...
tensorflow/docs-l10n
site/zh-cn/agents/tutorials/9_c51_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...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch4-Problem_4-09.ipynb
unlicense
%pylab notebook """ Explanation: Excercises Electric Machinery Fundamentals Chapter 4 Problem 4-9 End of explanation """ n_nl1 = 3650.0 # [r/min] n_fl1 = 3570.0 # [r/min] p_1 = 2 n_nl2 = 1800.0 # [r/min] n_fl2 = 1780.0 # [r/min] p_2 = 4 S_1 = 250e3 # [VA] S_2 = 250e3 # [VA] PF_1 = 0.8 PF_2 = 0.85 Pload = 300e3 # [W]...
bryanwweber/thermostate
docs/diesel-cycle-example.ipynb
bsd-3-clause
from thermostate import State, Q_, units from thermostate.plotting import IdealGas %matplotlib inline import matplotlib.pyplot as plt from numpy import arange """ Explanation: Diesel Cycle Example Imports End of explanation """ substance = 'air' T_1 = Q_(25.0, 'degC') p_1 = Q_(95.0, 'kPa') V_1 = Q_(3.0, 'L') r = Q_(...
makism/dyfunconn
tutorials/EEG - 2 - Static Connectivity.ipynb
bsd-3-clause
import numpy as np import scipy from scipy import io eeg = np.load("data/eeg_eyes_opened.npy") num_trials, num_channels, num_samples = np.shape(eeg) eeg_ts = np.squeeze(eeg[0, :, :]) """ Explanation: In this short tutorial, we will compute the static connectivity of the EEG singals. Load data End of explanation "...
zrhans/python
topicos/calibracao-temperatura.ipynb
gpl-2.0
%matplotlib notebook import numpy as np import matplotlib from matplotlib import pyplot as plt import pandas as pd df=pd.read_table('./data/temperatura.txt',sep='\s',header=0, engine='python') df.head() fig, ax1 = plt.subplots() ax1.plot(df.Xi, 'b') ax1.plot(df.Y1, 'y') #ax1.set_xlabel('time (s)') # Make the y-axis...
hbwzhsh/pyDataScienceToolkits_Base
NumPy/.ipynb_checkpoints/(4)common_functions2——stock_analysis-checkpoint.ipynb
mit
import numpy as np """ Explanation: 内容索引 计算股票收益率---- diff做差分、std求标准差、where函数返回满足条件的数组索引 日期分析例子---- 载入文件对日期的处理、where和take函数、argmax和argmin函数 周汇总例子---- apply_along_axis函数会调用一个自定义函数,作用于每一个数组元素上 线性模型预测价格---- linalg.lstsq函数 绘制趋势线例子---- ndarray补充---- clip函数,修剪; compress函数,压缩; prod函数,相乘; cumprod函数,累积乘积。 上一小节,介绍了...
GuillaumeDec/machine-learning
deep-lstm-rnn-anomaly-detector/deep-lstm-time-series-ndim-OI.ipynb
gpl-3.0
from __future__ import print_function import mxnet as mx from mxnet import nd, autograd import numpy as np from collections import defaultdict mx.random.seed(1) # ctx = mx.gpu(0) ctx = mx.cpu(0) %matplotlib inline import matplotlib import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import scipy....
estepona/PERCEIVE-freddie
TopicFlow_topicSimilarityTest_Zhang_08-31.ipynb
mit
# read a test version (w/o JS codes) of TopicSimilarity.json file = 'testSim.json' with open(file) as train_file: dict_train = json.load(train_file) dict_train len(dict_train['links']), len(dict_train['nodes']) links = pd.DataFrame(dict_train['links']) nodes = pd.DataFrame(dict_train['nodes']) links.head(2) li...
boffi/boffi.github.io
dati_2016/04/Constant_Acceleration.ipynb
mit
m = 1.00 k = 4*pi*pi wn = 2*pi T = 1.0 z = 0.02 wd = wn*sqrt(1-z*z) c = 2*z*wn*m """ Explanation: Constant Acceleration Define the Dynamical System End of explanation """ NSTEPS = 200 # steps per second h = 1.0 / NSTEPS def load(t): return np.where(t<0, 0, np.where(t<5, sin(0.5*wn*t)**2, 0)) t = np.linspace(-1,...
ToqueWillot/M2DAC
FDMS/TME3/Submit_V0.ipynb
gpl-2.0
# from __future__ import exam_success from __future__ import absolute_import from __future__ import print_function %matplotlib inline import sklearn import matplotlib.pyplot as plt import seaborn as sns import numpy as np import random import pandas as pd import scipy.stats as stats # Sk cheats from sklearn.cross_val...
gfeiden/Notebook
Projects/pleiades_colors/isochrone_interp.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Interpolate Isochrones for Praesepe Instead of interpolating boundary condition tables and computing a new set of models, we can interpolate between two metallicities to calculate new isochrones for Praesepe at metallicities between...
guyk1971/deep-learning
batch-norm/Batch_Normalization_Exercises_MySol.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 – Practice Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con...
rhyswhitley/fire_limitation
notebooks/data_viz.ipynb
bsd-3-clause
# data munging and analytical libraries import re import os import numpy as np import pandas as pd # graphical libraries import matplotlib.pyplot as plt import matplotlib.pylab as pylab # default plot settings for notebook from IPython.core.pylabtools import figsize figsize(11, 9) plt.style.use('ggplot') %matplotli...
sysid/nbs
LP/Introduction-to-linear-programming/Introduction to Linear Programming with Python - Part 4.ipynb
mit
import pulp # Instantiate our problem class model = pulp.LpProblem("Cost minimising blending problem", pulp.LpMinimize) """ Explanation: Introduction to Linear Programming with Python - Part 4 Real world examples - Blending Problem We're going to make some sausages! We have the following ingredients available to us: ...
trsherborne/learn-python
lesson7.ipynb
mit
# Run this if you are using a Mac machine or have multiple versions of Python installed !pip3 install numpy==1.11.1 pandas==0.19.1 matplotlib==1.5.3 seaborn==0.7.1 --upgrade # Run this if you are using a Windows machine !pip install numpy==1.11.1 pandas==0.19.0 matplotlib==1.5.3 seaborn==0.7.1 --upgrade # Everyone ru...
Serulab/Py4Bio
notebooks/Chapter 18 - Calculating Melting Temperature from a Set of Primers.ipynb
mit
!pip install biopython !curl https://raw.githubusercontent.com/Serulab/Py4Bio/master/samples/samples.tar.bz2 -o samples.tar.bz2 !mkdir samples !tar xvfj samples.tar.bz2 -C samples """ Explanation: Python for Bioinformatics This Jupyter notebook is intented to be used alongside the book Python for Bioinformatics Chap...
isb-cgc/examples-Python
notebooks/TCGA Annotations.ipynb
apache-2.0
import gcp.bigquery as bq annotations_BQtable = bq.Table('isb-cgc:tcga_201607_beta.Annotations') """ Explanation: TCGA Annotations The goal of this notebook is to introduce you to the TCGA Annotations BigQuery table. You can find more detail about Annotations on the TCGA Wiki, but the key things to know are: * an ann...
StudyExchange/Udacity
MachineLearning(Advanced)/p3_creating_customer_segments/.ipynb_checkpoints/customer_segments-checkpoint.ipynb
mit
%%time # 引入这个项目需要的库 import numpy as np import pandas as pd import visuals as vs from IPython.display import display # 使得我们可以对DataFrame使用display()函数 # 设置以内联的形式显示matplotlib绘制的图片(在notebook中显示更美观) %matplotlib inline # 载入整个客户数据集 try: data = pd.read_csv("customers.csv") data.drop(['Region', 'Channel'], axis = 1, ...
dcavar/python-tutorial-for-ipython
notebooks/Linear Algebra.ipynb
apache-2.0
x = (1, 2, 3, 4) y = (5, 6, 7, 8) n = len(x) if n == len(y): result = 0 for i in range(n): result += x[i] * y[i] print(result) """ Explanation: Linear Algebra (C) 2018-2019 by Damir Cavar Version: 1.1, September 2019 Download: This and various other Jupyter notebooks are available from my GitHub re...
FiryZeplin/deep-learning
sentiment-rnn/Sentiment_RNN_Solution.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
darcamo/pyphysim
apps/ia/IA Results 3x3(2).ipynb
gpl-2.0
%pylab inline """ Explanation: Simulation Results for varying number of maximum iterations This notebook shows BER and Sum Capacity results for different IA algorithms when the maximum number of allowed iterations is limited. Note that the algorithm might run less iterations than the allowed maximum if the precoders ...
DJCordhose/ai
notebooks/workshops/d2d/cnn-train-augmented.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...
jasonfeiwang/data-512-a1
hcds-a1-data-curation.ipynb
mit
# import all python libraries needed in this analysis import requests import json import pandas as pd from pandas.io.json import json_normalize import matplotlib.pyplot as plt from datetime import datetime # provide my credential for API access headers={'User-Agent' : 'https://github.com/jasonfeiwang', 'From' : 'fwang...
mne-tools/mne-tools.github.io
0.17/_downloads/a271bc382505fca1eb3f2c32f85b865f/spm_faces_dataset.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) # sphinx_gallery_thumbnail_number = 10 import matplotlib.pyplot as plt import mne from mne.datasets import spm_face from mne.preprocessing import ICA, create_eog_ep...
PythonFreeCourse/Notebooks
week02/7_Summary.ipynb
mit
# כתבו את הפונקציה שלכם כאן """ Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית."> <p style="tex...
Merinorus/adaisawesome
Homework/03 - Interactive Viz/.ipynb_checkpoints/HW3_Interactive_Viz-checkpoint.ipynb
gpl-3.0
import pandas as pd import numpy as np # We will read json files, for instance API keys stored in our computers for using Google Maps API, so they're not publicly visible import json # Geolocation import geopy from geopy.geocoders import geonames import math import logging p3_grant_export_data = pd.read_csv("P3_GrantE...
heprom/pymicro
examples/SampleDataUserGuide/SampleData_Quick_Reference_Sheet.ipynb
mit
from pymicro.core.samples import SampleData as SD """ Explanation: SampleData Quick Reference Sheet Notation In the code lines constituting this reference sheet, the following notation conventions are used in the SampleData method arguments: node_name, group_name, data_item_name are the Name, Indexname, Path or Alias...
computational-class/cjc2016
code/05.PythonCrawler_tianya_threads.ipynb
mit
import requests from bs4 import BeautifulSoup """ Explanation: 数据抓取: 使用Python编写网络爬虫 王成军 wangchengjun@nju.edu.cn 计算传播网 http://computational-communication.com 需要解决的问题 页面解析 获取Javascript隐藏源数据 自动翻页 自动登录 连接API接口 End of explanation """ from IPython.display import display_html, HTML HTML('<iframe src= http://bbs.tianya....
tensorflow/docs
site/en/guide/tf_numpy.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
marcinofulus/teaching
ML_SS2017/numpy_rachunek_rozniczkowy.ipynb
gpl-3.0
import numpy as np x = np.linspace(0, 10, 10) f = np.sin(x) f1 = np.cos(x) df = f[1:] - f[:-1] dx = x[1:] - x[:-1] x2 = (x[1:] + x[:-1])/2 fp = df/dx fp.shape, x.shape %matplotlib inline import matplotlib.pyplot as plt plt.plot(x2, np.cos(x2), 'o-') plt.plot(x2, fp, 'ro-') """ Explanation: Pochodna (różniczkow...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/.ipynb_checkpoints/Statements Assessment Test-checkpoint.ipynb
apache-2.0
st = 'Print only the words that start with s in this sentence' #Code here """ Explanation: Statements Assessment Test Lets test your knowledge! Use for, split(), and if to create a Statement that will print out words that start with 's': End of explanation """ #Code Here """ Explanation: Use range() to print all ...
PBrockmann/ipython_ferretmagic
notebooks/ferretmagic_01_Discovering.ipynb
mit
%load_ext ferretmagic """ Explanation: <hr> Patrick BROCKMANN - LSCE (Climate and Environment Sciences Laboratory)<br> <img align="left" width="40%" src="http://www.lsce.ipsl.fr/Css/img/banniere_LSCE_75.png" ><br><br> <hr> Updated: 2019/11/13 Install the ferret extension ferretmagic extension is now a package you can...
mne-tools/mne-tools.github.io
0.23/_downloads/8ea2bfc401dbdff70c284d271d62fa8c/label_from_stc.ipynb
bsd-3-clause
# Author: Luke Bloy <luke.bloy@gmail.com> # Alex Gramfort <alexandre.gramfort@inria.fr> # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.minimum_norm import read_inverse_operator, apply_inverse from mne.datasets import sample print(__doc__) data_path = sample....
sthuggins/phys202-2015-work
assignments/assignment03/NumpyEx01.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import antipackage import github.ellisonbg.misc.vizarray as va """ Explanation: Numpy Exercise 1 Imports End of explanation """ import numpy as np def checkerboard(size): """Return a 2d checkboard of 0.0 and 1.0 as a Nu...
brandoncgay/deep-learning
batch-norm/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...
mikekestemont/ruzicka
code/Quickstart.ipynb
mit
ls ../data/2014/du_essays/train """ Explanation: Ružička: Authorship Verification in Python In this notebook, we offer a quick tutorial as to how you could use the code in this repository. While the package is very much geared towards our own work in authorship verification, you might some of the more general function...
niazangels/CADL
session-5/lecture-5.ipynb
apache-2.0
# First check the Python version import sys if sys.version_info < (3,4): print('You are running an older version of Python!\n\n', 'You should consider updating to Python 3.4.0 or', 'higher as the libraries built for this course', 'have only been tested in Python 3.4 and higher.\n') ...
DickJC123/mxnet
example/multi-task/multi-task-learning.ipynb
apache-2.0
import logging import random import time import matplotlib.pyplot as plt import mxnet as mx from mxnet import gluon, np, npx, autograd import numpy as onp """ Explanation: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work...
ES-DOC/esdoc-jupyterhub
notebooks/inm/cmip6/models/sandbox-1/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inm', 'sandbox-1', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: INM Source ID: SANDBOX-1 Topic: Ocean Sub-Topics: Timestepping Framework, Advection, ...
CalebVuorinen/summerstudentProtoWork
functional/Example_01.ipynb
mit
import ROOT from PyTreeReader import PyTreeReader from functional import DataFrame from ROOT import TFile """ Explanation: DataFrame: Functional Chains for TTrees in Python. <hr style="border-top-width: 4px; border-top-color: #359C38;"> The DataFrame class brings the feature called functional chains with caching to tr...
rflamary/POT
notebooks/plot_otda_color_images.ipynb
mit
# Authors: Remi Flamary <remi.flamary@unice.fr> # Stanislas Chambon <stan.chambon@gmail.com> # # License: MIT License import numpy as np from scipy import ndimage import matplotlib.pylab as pl import ot r = np.random.RandomState(42) def im2mat(I): """Converts an image to matrix (one pixel per line)"""...
clustbench/network-tests2
clustering/by_topology/lom2-agnostic-code.ipynb
lgpl-2.1
nodes = pd.read_pickle("cachenodes.pkl") edges = pd.read_pickle("edges.pkl") comp_nodes = pd.read_pickle("comp_nodes.pkl") """ Explanation: Load data End of explanation """ def build_topology(nodes, edges): topology = nx.Graph() # add all nodes for index, row in nodes.iterrows(): node_name =...
LukasDrude/jupyter_search
index.ipynb
mit
import nbformat """ Explanation: Dependencies: - whoosh - yattag - hurry.filesize End of explanation """ from whoosh.index import create_in from whoosh.fields import * from whoosh.qparser import QueryParser """ Explanation: nbformat doc: http://nbformat.readthedocs.org/en/latest/api.html End of explanation """ ...
ES-DOC/esdoc-jupyterhub
notebooks/niwa/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', 'niwa', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: NIWA Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Conce...
getsmarter/bda
module_5/M5_NB2_BandicootMachineLearning.ipynb
mit
# Load libraries and set options. import matplotlib.pyplot as plt import bandicoot as bc from tqdm import tqdm_notebook as tqdm # Interactive progress bar. import glob import os import pandas as pd import numpy as np from scipy.stats import norm %matplotlib inline plt.rcParams['figure.figsize'] = (15, 9) plt.rcParams...
betatim/BlackBox
examples/interruptible-optimization.ipynb
bsd-3-clause
import numpy as np np.random.seed(777) """ Explanation: Interruptible optimization runs with checkpoints Christian Schell, Mai 2018 End of explanation """ from skopt import gp_minimize from skopt import callbacks from skopt.callbacks import CheckpointSaver noise_level = 0.1 def obj_fun(x, noise_level=noise_level):...
KTH-dESA/PyOnSSET-jupyter
pyonsset.ipynb
mit
country = 'Malawi' #Dependencies from IPython.display import display, Markdown, HTML import seaborn as sns import matplotlib.pylab as plt import folium import branca.colormap as cm import json %matplotlib inline %run onsset.py """ Explanation: Welcome to OnSSET Jupyter Interface¶ This page will guide you through the ...
nickcdryan/hep_ml
notebooks/DemoReweighting.ipynb
apache-2.0
%pylab inline figsize(16, 8) import root_numpy import pandas from hep_ml import reweight """ Explanation: Demonstration of distribution reweighting hep_ml.reweight contains methods to reweight distributions. Typically we use reweighting of monte-carlo to fight drawbacks of simulation, though there are many applicati...
mari-linhares/tensorflow-workshop
code_samples/RNN/sentiment_analysis/SentimentAnalysis-Word2Vec.ipynb
apache-2.0
# Tensorflow import tensorflow as tf print('Tested with TensorFlow 1.2.0') print('Your TensorFlow version:', tf.__version__) # Feeding function for enqueue data from tensorflow.python.estimator.inputs.queues import feeding_functions as ff # Rnn common functions from tensorflow.contrib.learn.python.learn.estimators i...
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
doc/notebooks/automaton.standard.ipynb
gpl-3.0
import vcsn b = vcsn.context('lal_char, z') a = b.expression('a').standard() | b.expression('b').standard() a a = a.standard() a """ Explanation: automaton.standard Turn an automaton into a standard automaton. Preconditions: - None Postconditions: - result.is_standard() See also: - automaton.is_standard - expression....
mathinmse/mathinmse.github.io
Lecture-19-Spectral-Solutions.ipynb
mit
import sympy as sp x, y, z, t = sp.symbols('x y z t') k, m, n = sp.symbols('k m n', integer=True) f, g, h = sp.symbols('f g h', cls=sp.Function) sp.var('a_k, phi, c', cls=sp.Function); sp.var('L', real=True); sp.init_printing(); """ Explanation: Lecture 19: Numerical Solutions to the Diffusion Equation (Spectral Met...
adrn/tutorials
notebooks/User-Defined-Model/User-Defined-Model.ipynb
cc0-1.0
import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from astropy.modeling import models, fitting from astropy.modeling.models import custom_model from astropy.modeling import Fittable1DModel, Parameter from astroquery.sdss import SDSS """ Explanation: Modeling 2: Create a User Defined Model ...
agushman/coursera
src/cours_2/week_5/task_nn.ipynb
mit
# Выполним инициализацию основных используемых модулей %matplotlib inline import random import matplotlib.pyplot as plt from sklearn.preprocessing import normalize import numpy as np """ Explanation: Нейронные сети: зависимость ошибки и обучающей способности от числа нейронов В этом задании вы будете настраивать двус...
darkomen/TFG
medidas/01072015/Analisis.ipynb
cc0-1.0
%pylab inline #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...
Saumya-Suvarna/machine-learning
Fuel_prediction/Fuel prediction and co2 emission.ipynb
apache-2.0
#importing the necessacary packages in python import matplotlib.pyplot as plt import pandas as pd import pylab as pl import numpy as np import statsmodels.formula.api as smf %matplotlib inline elec = pd.read_csv("fuel consumption dataset\MY2012-2017 Battery Electric Vehicles.csv") elec.head() #display the column names...
jmschrei/pomegranate
examples/hmm_example.ipynb
mit
import random from pomegranate import * random.seed(0) """ Explanation: Hidden Markov Model Example authors:<br> Jacob Schreiber [<a href="mailto:jmschreiber91@gmail.com">jmschreiber91@gmail.com</a>]<br> Nicholas Farn [<a href="mailto:nicholasfarn@gmail.com">nicholasfarn@gmail.com</a>] A simple example highlighting h...
dnstanciu/masters-project
sources/notebooks/classification.ipynb
gpl-3.0
import numpy as np import random random.seed(20) import matplotlib # Set backend to pgf matplotlib.use('pgf') import matplotlib.pyplot as plt # Some nice default configuration for plots plt.rcParams['figure.figsize'] = 10, 7.5 plt.rcParams['axes.grid'] = True #plt.gray() %matplotlib inline from scipy.io import lo...
mayank-johri/LearnSeleniumUsingPython
Section 3 - Machine Learning/ThirdParty-scikit-learn-videos-master/04_model_training.ipynb
gpl-3.0
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...
angelmtenor/data-science-keras
text_generator.ipynb
mit
%matplotlib inline import os import numpy as np import matplotlib.pyplot as plt import seaborn as sns import keras import helper helper.reproducible(seed=9) sns.set() """ Explanation: English sequence generator Creating an English language sequence generator capable of building semi-coherent English sentences from s...
km-Poonacha/python4phd
Session 1/ipython/Excercise - Working With CSV-Worksheet.ipynb
gpl-3.0
from google.colab import drive from google.colab import files drive.mount('/content/drive/') uploaded = files.upload() """ Explanation: Excercise - Working With CSV Using the CSV module A CSV file is often used exchange format for spreadsheets and databases. Each line is called a record and each field within a record...
vvishwa/deep-learning
gan_mnist/Intro_to_GANs_Solution.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...
omaclaren/open-learning-material
inverse-problems/2021/code/L02-equation-solving.ipynb
mit
import numpy as np from IPython.display import set_matplotlib_formats set_matplotlib_formats('png', 'pdf') """ Explanation: Equation solving using pseudo-inverses Author: OJM. We saw that inverses are unstable even when exist Before we deal with stability, let's deal with existence and uniqueness Same stabilit...
YaleDHLab/lab-workshops
generative-art/minimal-autoencoder.ipynb
mit
# load special jupyter notebook helpers %matplotlib inline # import libraries we'll use below import matplotlib.pyplot as plt from scipy.misc import imread from glob import glob import numpy as np import requests import zipfile import warnings import os warnings.filterwarnings('ignore') """ Explanation: Creating Gen...
brian-rose/ClimateModeling_courseware
Lectures/Lecture06 -- Radiation.ipynb
mit
# Ensure compatibility with Python 2 and 3 from __future__ import print_function, division """ Explanation: ATM 623: Climate Modeling Brian E. J. Rose, University at Albany Lecture 6: A Brief Review of Radiation Warning: content out of date and not maintained You really should be looking at The Climate Laboratory boo...
parambharat/ML-Programs
P2:_student_intervention/P2 Building a Student Intervention System.ipynb
mit
# Import libraries import numpy as np import pandas as pd from IPython.display import display, HTML from collections import defaultdict # Read student data student_data = pd.read_csv("student-data.csv") print "Student data read successfully!" # Note: The last column 'passed' is the target/label, all other are feature...
unmrds/cc-python
Loops and Functions.ipynb
apache-2.0
# A list is a mutable, ordered collection # Collections can be heterogenous: integers, strings, other data structures, etc. # can all be added to a single list. # Creating lists: # Initialize an empty list: my_movies = [] print(my_movies, type(my_movies)) # Initialize a list with one or more objects in it unwatch...
tuanavu/coursera-university-of-washington
machine_learning/4_clustering_and_retrieval/assigment/week2/1_nearest-neighbors-lsh-implementation_blank.ipynb
mit
import numpy as np import graphlab from scipy.sparse import csr_matrix from scipy.sparse.linalg import norm from sklearn.metrics.pairwise import pairwise_distances import time from copy import copy import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Locality Sensitive Hashing Locality Sensitive Hashing...
tensorflow/docs-l10n
site/en-snapshot/tensorboard/scalars_and_keras.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...
jasag/Phytoliths-recognition-system
code/notebooks/Prototypes/Classifiers_and_HoG/1_HoG.ipynb
bsd-3-clause
from sklearn.datasets import fetch_lfw_people faces = fetch_lfw_people() positive_patches = faces.images positive_patches.shape """ Explanation: Características de HoG En este notebook creará un conjunto de imagenes con caras y no caras mediante las que obtendremos las características de HoG que nos servirán como conj...
sgratzl/ipython-tutorial-VA2015
03_Plotting.ipynb
cc0-1.0
#disable some annoying warning import warnings warnings.filterwarnings('ignore', category=FutureWarning) #plots the figures in place instead of a new window %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np #use a standard dataset of heterogenous data ca...
dtamayo/reboundx
ipython_examples/Migration.ipynb
gpl-3.0
import rebound import reboundx import numpy as np sim = rebound.Simulation() ainner = 1. aouter = 10. e0 = 0.1 inc0 = 0.1 sim.add(m=1.) sim.add(m=1e-6,a=ainner,e=e0, inc=inc0) sim.add(m=1e-6,a=aouter,e=e0, inc=inc0) sim.move_to_com() # Moves to the center of momentum frame ps = sim.particles """ Explanation: Migratio...
geo-fluid-dynamics/phaseflow-fenics
tutorials/Phaseflow/LidDrivenCavity.ipynb
mit
import phaseflow import fenics import matplotlib %matplotlib inline """ Explanation: This tutorial demonstrates how to use FEniCS and the phaseflow.abstract_simulation.AbstractSimulation class as an interface for implementing time-dependent simulations with mixed finite elements and goal-oriented adaptive mesh refinem...
eblur/clarsach
notebooks/ParTest_ProofOfConcept.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt try: import seaborn as sns except ImportError: print("No seaborn installed. Oh well.") import numpy as np from scipy.special import gammaln as scipy_gammaln import scipy.stats import astropy.io.fits as fits import astropy.modeling.models as models from a...
udacity/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...
LDSSA/learning-units
units/11-validation-metrics/examples/01 - Validation Metrics for Classification.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score, precision_score, \ recall_score, f1_score, roc_auc_score, roc_curve, confusion_matrix %matplotlib inline """ Explanation: Example - Validation Metrics for Classification Scikit-learn covers extensive...
GoogleCloudPlatform/tf-estimator-tutorials
03_Clustering/02.0 - TF k-means - Estimator API.ipynb
apache-2.0
train_data_files = ['data/train-data.csv'] test_data_files = ['data/test-data.csv'] model_name = 'clust-model-01' resume = False train = True preprocess_features = False extend_feature_colums = False """ Explanation: Steps to use the TF Estimator APIs Define dataset metadata Define data input function to read the d...
pdh21/XID_plus
docs/notebooks/examples/SED_emulator/JAX_CIGALE_emulator-kasia.ipynb
mit
from astropy.cosmology import WMAP9 as cosmo import jax import numpy as onp import pylab as plt import astropy.units as u import scipy.integrate as integrate %matplotlib inline import jax.numpy as np from jax import grad, jit, vmap, value_and_grad from jax import random from jax import vmap # for auto-vectorizing fun...
psiq/gdsfactory
notebooks/03_references.ipynb
mit
from IPython.display import Image Image("../docs/images/gds.png") """ Explanation: References GDS allows defining the component once in memory and reference to that structure in other components. End of explanation """ import pp """ Explanation: Adding a component reference As we build complex circuit we'll make ci...
phobson/paramnormal
docs/tutorial/activities.ipynb
mit
%matplotlib inline import warnings warnings.simplefilter('ignore') from numpy.random import seed from scipy import stats from matplotlib import pyplot import seaborn import paramnormal clean_bkgd = {'axes.facecolor':'none', 'figure.facecolor':'none'} seaborn.set(style='ticks', rc=clean_bkgd) """ Explanation: Param...
oturing/pymanas
labs/Viagem a Jupyter.ipynb
gpl-3.0
def fatorial(n): return 1 if n < 2 else n * fatorial(n-1) fatorial(42) """ Explanation: Jupyter Notebook é uma ferramenta excelente para: Exploração interativa de dados; Análise de dados (i.e. Analytics); Aprender Python, R, Julia e dezenas de outras linguagens suportadas O nome Jupyter é mistura de Julia, Pyth...
dlsun/symbulate
docs/common_discrete.ipynb
mit
from symbulate import * %matplotlib inline """ Explanation: Symbulate Documentation Common Discrete Distributions Introduction to discrete distributions and random variables Defining a general discrete distribution with BoxModel Discrete Uniform Bernoulli Binomial Hypergeometric Poisson Geometric Negative Binomial (a...
dtherrick/dataviz_baseball
iPython/2 - Scrape and Plot 2015 Baseball Standings-Copy1.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt import ipywidgets from IPython.display import display from collections import OrderedDict %matplotlib inline pd.options.mode.chained_assignment = None # default='warn' """ Explanation: 2. Scrape and Plot 2015 Baseball Standings (matplotlib) Begin by importing our ...
relopezbriega/mi-python-blog
content/notebooks/MachineLearningPractica.ipynb
gpl-2.0
# <!-- collapse=True --> # Importando las librerías que vamos a utilizar import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import LabelEncoder # graficos incrustados %matplotlib inline # parametros esteticos de seaborn sns.set_palette("deep", de...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session03/Day2/OOP.ipynb
mit
import matplotlib.pyplot as plt import random import numpy as np %matplotlib inline """ Explanation: DSFP Object Oriented Programming Notebook Incorporating classes, objects, and functions into your code will improve its efficiency, readability, and make it easier to extend to other programs down the road. This note...
sdpython/actuariat_python
_doc/notebooks/sessions/population_recuperation_donnees.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt plt.style.use('ggplot') # le code qui suit n'est pas indispensable, il génère automatiquement un menu # dans le notebook from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: Récupération des données Ce notebook donne quelques exemples de co...
tensorflow/docs-l10n
site/pt-br/tutorials/keras/regression.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...
massimo-nocentini/PhD
notebooks/words-avoiding-riordan-patterns.ipynb
apache-2.0
from sympy import * from IPython.display import Markdown, Latex from oeis import oeis_search init_printing() %run ~/Developer/working-copies/programming-contests/competitive-programming/python-libs/oeis.py """ Explanation: <p> <img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jpg" alt...
mne-tools/mne-tools.github.io
0.21/_downloads/7f0f8817512fdcca1eab8f4befa07ff9/plot_metadata_query.ipynb
bsd-3-clause
# Authors: Chris Holdgraf <choldgraf@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import os import pandas as pd import matplotlib.pyplot as plt import mne # First load some data events = mne.read_events(os.path.join(mne...
anthonyng2/FX-Trading-with-Python-and-Oanda
Oanda v1 REST-oandapy/10.00 Bonus Materials II.ipynb
mit
import numpy as np import pandas as pd import oandapy import configparser %matplotlib inline import seaborn as sns import matplotlib.pyplot as plt config = configparser.ConfigParser() config.read('../config/config_v1.ini') account_id = config['oanda']['account_id'] api_key = config['oanda']['api_key'] oanda = oandapy...
Chipe1/aima-python
viterbi_algorithm.ipynb
mit
from probability import * %psource HiddenMarkovModel """ Explanation: Probabilistic Reasoning over Time Finding the Most Likely Sequence with Viterbi Algorithm Introduction An Hidden Markov Model (HMM) network is parameterized by two distributions: the emission or sensor probabilties giving the conditional probabil...
MarcKjerland/Worst-Winter-Ever
worst-winter-mpls.ipynb
mit
import pandas as pd # Read data, sort by year & month dateparse = lambda x: pd.datetime.strptime(x, '%Y%m%d') noaa_monthly = pd.read_csv('mpls-noaa.csv', index_col=2, parse_dates=True, date_parser=dateparse, na_values=-9999) noaa_monthly = noaa_monthly.groupby([noaa_monthly.index.year, noaa_m...
lknelson/text-analysis-2017
04-Dictionaries/00-DictionaryMethod.ipynb
bsd-3-clause
#import the necessary packages import pandas import nltk from nltk import word_tokenize import string #read the Music Reviews corpus into a Pandas dataframe df = pandas.read_csv("../Data/BDHSI2016_music_reviews.csv", encoding='utf-8', sep = '\t') #view the dataframe df """ Explanation: Dictionary Method This is the ...
betoesquivel/onforums-application
testdataextractor/TestDataExtractor.ipynb
mit
from bs4 import BeautifulSoup f = open('../test_data/1957284403.ofs.gold.xml', 'r') article_text = f.read(); soup = BeautifulSoup(article_text, "lxml") comment = { "bloggerId": "author", "sentences": [], # all sentences in a comment, "parents": [] # the order depends on how beautifulsoup gives me the pare...
musketeer191/job_analytics
.ipynb_checkpoints/skill_cluster4-checkpoint.ipynb
gpl-3.0
import numpy as np import pandas as pd import sklearn.feature_extraction.text as text_manip import matplotlib.pyplot as plt import gc from sklearn.decomposition import NMF, LatentDirichletAllocation from time import time from scipy.sparse import * # my own modules from my_util import * from helpers import * """ Expl...
vascotenner/holoviews
doc/Tutorials/Options.ipynb
bsd-3-clause
import numpy as np import holoviews as hv hv.notebook_extension() x,y = np.mgrid[-50:51, -50:51] * 0.1 image = hv.Image(np.sin(x**2+y**2), group="Function", label="Sine") coords = [(0.1*i, np.sin(0.1*i)) for i in range(100)] curve = hv.Curve(coords) curves = {phase: hv.Curve([(0.1*i, np.sin(phase+0.1*i)) for i in r...
TheMitchWorksPro/DataTech_Playground
PY_Basics/TMWP_Python_Getting_Names_of_Things.ipynb
mit
from dill.source import getname # run this cell first before any cells below peg1 = [1,2] peg2 = [3] peg3 = [5,4] # this example shows what at first would appear to be unexpected behavior # it illustrates some concepts though later cells of this notebook show how to effectively use dill.getname def move_from(sour...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/pandas/03.11-Working-with-Time-Series.ipynb
mit
from datetime import datetime datetime(year=2015, month=7, day=4) """ Explanation: <!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub. Th...
bioinformatica-corso/lezioni
laboratorio/lezione2-01ott21/lezione2-strutture-controllo.ipynb
cc0-1.0
my_number = 15 if my_number > 10: print("My number is bigger than 10") """ Explanation: Python - Strutture di controllo dell'esecuzione Strutture di selezione Costrutto if Costrutto if-else Costrutto if-elif Strutture iterative Ciclo while Costrutto if if [condition]: [if_block] [condition]: espressio...