repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
HrantDavtyan/Data_Scraping | Week 4/Craftcans.com_cleaning.ipynb | apache-2.0 | import pandas, re
data = pandas.read_excel("craftcans.xlsx")
data.head()
"""
Explanation: Craftcans.com - cleaning
Craftcans.com provides a database of 2692 crafted canned beers. The data on beers includes the following variables:
Name
Style
Size
Alcohol by volume (ABV)
IBU’s
Brewer name
Brewer location
However, s... |
Wx1ng/Python4DataScience.CH | Series_0_Python_Tutorials/S0EP4_Python_In_Practice.ipynb | cc0-1.0 | import csv
import codecs
import numpy as np
import pandas as pd
"""
Explanation: Python In Practice: 实践为王
1 文件读写:到此一游
观光传送门:
https://github.com/BinRoot/Haskell-Data-Analysis-Cookbook/tree/master/Ch01
即使是售价高达$54.99的《Haskell Data Analysis Cookbook》里,第一章也只能讲点平淡无奇的如何读入以下各种形式的文本
TXT,DAT(纯文本,里面的格式你已经有一定的了解)
CSV,TSV(Comma/... |
shumway/srt_bootcamp | KochSnowflake.ipynb | mit | a = (0.0, 0.0)
e = (1.0, 0.0)
ae = (a,e)
"""
Explanation: Koch Snowflake Introduction
A Koch Snowflake is a fractal that has been known for over 100 years
(see the Wikipedia article
for history).
The shaped is formed by starting from a triangle. For each line segment, remove the middle third
and replace it by two eq... |
PositroniumSpectroscopy/positronium | notebooks/Fine structure.ipynb | bsd-3-clause | # load packages
from IPython.display import Latex
from positronium import Ps, Bohr
from positronium.constants import h, frequency_hfs
from positronium.interval import frequency
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
"""
Explanation: Fine structure
End of explanation
"""
# ortho-PS
s131... |
phoebe-project/phoebe2-docs | development/tutorials/rv_offset.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Radial Velocity Offsets (rv_offset)
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
from phoebe import u # units
impor... |
sjsrey/giddy | tools/gitcount.ipynb | bsd-3-clause | # get date of last tag
from subprocess import Popen, PIPE
x, err = Popen('git log -1 --tags --simplify-by-decoration --pretty="%ai"| cat', stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True).communicate()
start_date = x.split()[0].decode('utf-8')
start_date
# today's date
import datetime
release_date = str(datetime.da... |
liganega/Gongsu-DataSci | previous/y2017/Wextra/GongSu26_Statistics_Hypothesis_Test_2.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
from scipy import stats
"""
Explanation: 자료 안내: 여기서 다루는 내용은 아래 사이트의 내용을 참고하여 생성되었음.
https://github.com/rouseguy/intro2stats
가설검정
주요내용
미국 51개 주에서 거래된 담배(식물) 도매가 데이터와 pandas 모듈을 활용하여 가설검정을 실행하는 방법을 터득한다.
주요 예제
캘리포니아 주에서 2014년도와 2015년도에 거래된 담배(식물)의 도매가의 가격차이 비교
검정방식
t-검정
카이제곱 검정
... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/03_model_performance/labs/c_custom_keras_estimator.ipynb | apache-2.0 | import tensorflow as tf
import numpy as np
import shutil
print(tf.__version__)
"""
Explanation: Custom Estimator with Keras
Learning Objectives
- Learn how to create custom estimator using tf.keras
Introduction
Up until now we've been limited in our model architectures to premade estimators. But what if we want more c... |
Chipe1/aima-python | agents.ipynb | mit | from agents import *
from notebook import psource
"""
Explanation: Intelligent Agents
This notebook serves as supporting material for topics covered in Chapter 2 - Intelligent Agents from the book Artificial Intelligence: A Modern Approach. This notebook uses implementations from agents.py module. Let's start by impor... |
atavory/ibex | examples/movielens_nmf.ipynb | bsd-3-clause | import os
from sklearn import base
import pandas as pd
import scipy as sp
import seaborn as sns
sns.set_style('whitegrid')
sns.despine()
import ibex
from ibex.sklearn import model_selection as pd_model_selection
from ibex.sklearn import decomposition as pd_decomposition
from ibex.sklearn import decomposition as pd_de... |
mne-tools/mne-tools.github.io | stable/_downloads/47923e53e0be940f05f054346a1ec113/elekta_epochs.ipynb | bsd-3-clause | # Author: Jussi Nurminen (jnu@iki.fi)
#
# License: BSD-3-Clause
import mne
import os
from mne.datasets import multimodal
fname_raw = os.path.join(multimodal.data_path(), 'multimodal_raw.fif')
print(__doc__)
"""
Explanation: Getting averaging info from .fif files
Parse averaging information defined in Elekta Vector... |
civisanalytics/muffnn | examples/mlp_prediction_gradient_digits.ipynb | bsd-3-clause | import base64
import io
import logging
from IPython.display import HTML, display
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import muffnn
from sklearn.datasets import load_digits
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_sel... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/robust_models_0.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import statsmodels.api as sm
"""
Explanation: Robust Linear Models
End of explanation
"""
data = sm.datasets.stackloss.load()
data.exog = sm.add_constant(data.exog)
"""
Explanation: Estimation
Load data:
End of explanation
"""
huber_t = sm.RLM... |
astroumd/GradMap | notebooks/Lectures2019/Lecture4/Lecture4-2BodyProblem2019-Student.ipynb | gpl-3.0 | #Physical Constants (SI units)
G=6.67e-11 #Universal Gravitational constant in m^3 per kg per s^2
AU=1.5e11 #Astronomical Unit in meters = Distance between sun and earth
daysec=24.0*60*60 #seconds in a day
"""
Explanation: Introduction to numerical simulations: The 2 Body Problem
Many problems in statistical physics a... |
computational-class/computational-communication-2016 | code/13.recsys_intro.ipynb | mit | # A dictionary of movie critics and their ratings of a small
# set of movies
critics={'Lisa Rose': {'Lady in the Water': 2.5, 'Snakes on a Plane': 3.5,
'Just My Luck': 3.0, 'Superman Returns': 3.5, 'You, Me and Dupree': 2.5,
'The Night Listener': 3.0},
'Gene Seymour': {'Lady in the Water': 3.0, 'Snakes... |
rochelleterman/scrape-interwebz | 1_APIs/3_api_workbook.ipynb | mit | # Import required libraries
import requests
import json
from __future__ import division
import math
import csv
import matplotlib.pyplot as plt
"""
Explanation: Accessing Databases via Web APIs
End of explanation
"""
# set key
key="be8992a420bfd16cf65e8757f77a5403:8:44644296"
# set base url
base_url="http://api.nyti... |
ethen8181/machine-learning | trees/decision_tree.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', 'notebook_format'))
from formats import load_style
load_style(css_style = 'custom2.css')
os.chdir(path)
# 1. magic for inline plot
# 2. magic to print ve... |
mne-tools/mne-tools.github.io | 0.23/_downloads/b89584de6ec99a847868d7b80a32cf50/80_dics.ipynb | bsd-3-clause | # Author: Marijn van Vliet <w.m.vanvliet@gmail.com>
#
# License: BSD (3-clause)
"""
Explanation: DICS for power mapping
In this tutorial, we'll simulate two signals originating from two
locations on the cortex. These signals will be sinusoids, so we'll be looking
at oscillatory activity (as opposed to evoked activity)... |
maestrotf/pymepps | docs/examples/example_plot_xr_accessor.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
import xarray as xr
import pymepps
"""
Explanation: How to use Xarray accessor
This example shows how to use the SpatialData accessor to extend the
capabilities of xarray.
To extend xarray.DataArray you need only to load also pymepps with
"import pymepps". The extensions could be used w... |
jrbourbeau/cr-composition | notebooks/legacy/lightheavy/laputop-performance.ipynb | mit | %load_ext watermark
%watermark -u -d -v -p numpy,matplotlib,scipy,pandas,sklearn,mlxtend
"""
Explanation: <a id='top'> </a>
Author: James Bourbeau
End of explanation
"""
%matplotlib inline
from __future__ import division, print_function
from collections import defaultdict
import numpy as np
from scipy import optimiz... |
jhillairet/scikit-rf | doc/source/examples/networktheory/LNA Example.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = [10, 10]
import skrf as rf
from skrf.media import DistributedCircuit
f = rf.Frequency(0.4, 2, 101)
tem = DistributedCircuit(f, z0=50)
# import the scattering parameters/noise data for the transistor
bjt = rf.Network('BFU520_05V0_010m... |
chrisjsewell/ipypublish | example/notebooks/Example.ipynb | bsd-3-clause | print("""
This is some printed text,
with a nicely formatted output.
""")
"""
Explanation: Markdown
General
Some markdown text.
A list:
something
something else
A numbered list
something
something else
This is a long section of text, which we only want in a document (not a presentation)
some text
some more text
so... |
ase16-ta/ga | ga.ipynb | mit | %matplotlib inline
# All the imports
from __future__ import print_function, division
from math import *
import random
import sys
import matplotlib.pyplot as plt
# TODO 1: Enter your unity ID here
__author__ = "<unity-id>"
class O:
"""
Basic Class which
- Helps dynamic updates
- Pretty Prints
... |
millernj/phys202-project | [2]Making the Network.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from IPython.html.widgets import interact
from sklearn.datasets import load_digits
from IPython.display import Image, display
digits = load_digits()
print(digits.data.shape)
def show_examples(i):
plt.matshow(digits.images[i].reshape((8,8)), cmap... |
mcamack/Jupyter-Notebooks | time-series/LSTM - Time-Series Forecasting - NAB Artificial with Noise.ipynb | apache-2.0 | from tensorflow import keras
"""
Explanation: LSTM Time Series Forecasting for NAB random signal
End of explanation
"""
import pandas as pd
import numpy as np
df_raw = pd.read_csv("datasets/NAB-art_daily_small_noise.csv")
df_raw.head()
df_raw.isna().sum()
df = df_raw.dropna()
df["timestamp"] = pd.to_datetime(df[... |
cerrno/neurokernel | notebooks/vision.ipynb | bsd-3-clause | %matplotlib inline
%cd -q ~/neurokernel/examples/vision/data
%run generate_vision_gexf.py
"""
Explanation: Vision Model Demo
This notebook illustrates how to run a Neurokernel-based model of portions of the fly's vision system.
Background
In addition to the retina where the photo-transduction takes place, the optic
lo... |
sanabasangare/data-visualization | fin_big_data.ipynb | mit | import numpy as np # for array operations
import pandas as pd # for time series management
from pandas_datareader import data as web # for data retrieval
import seaborn as sns; sns.set() # for a nicer plotting style
# put all plots in the notebook itself
%matplotlib inline
"""
Explanation: Analyzing Financial Dat... |
google/applied-machine-learning-intensive | content/03_regression/01_introduction_to_sklearn/colab.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
dwhswenson/openpathsampling | examples/alanine_dipeptide_mstis/AD_mstis_2_run.ipynb | mit | %matplotlib inline
import openpathsampling as paths
import numpy as np
import math
# the openpathsampling OpenMM engine
import openpathsampling.engines.openmm as eng
"""
Explanation: Run from bootstrap paths
Now we will use the initial trajectories we obtained from bootstrapping to run an MSTIS simulation. This will... |
edouardklein/JsItBad | JsItBad.ipynb | agpl-3.0 | import glob
import string
import re
import numpy as np
# Loading the data
data = []
for js_file in glob.glob('Javascript/*/*'):
new = {}
new['name'] = js_file.split('/')[-1]
new['code'] = open(js_file,'r').read()
if new['name'][-2:] == 'js':
if new['name'][-6:] == 'min.js':
new['nat... |
tpin3694/tpin3694.github.io | machine-learning/calculate_difference_between_dates_and_times.ipynb | mit | # Load library
import pandas as pd
"""
Explanation: Title: Calculate Difference Between Dates And Times
Slug: calculate_difference_between_dates_and_times
Summary: How to calculate differences between dates and times for machine learning in Python.
Date: 2017-09-11 12:00
Category: Machine Learning
Tags: Preprocessi... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/CNN/project-dog-classification/dog_app.ipynb | apache-2.0 | import numpy as np
from glob import glob
# load filenames for human and dog images
human_files = np.array(glob("lfw/*/*"))
dog_files = np.array(glob("dogImages/*/*/*"))
# print number of images in each dataset
print('There are %d total human images.' % len(human_files))
print('There are %d total dog images.' % len(do... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/04_advanced_preprocessing/a_dataflow.ipynb | apache-2.0 | #Ensure that we have the correct version of Apache Beam 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: Data Preprocessing for Machine Learning
Learning Objectives
* ... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/mixed_lm_example.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
from statsmodels.tools.sm_exceptions import ConvergenceWarning
"""
Explanation: Linear Mixed Effects Models
End of explanation
"""
data = sm.datasets.get_rdataset("dietox", "geepack").data
md... |
encima/Comp_Thinking_In_Python | Session_2/2_Homework.ipynb | mit | name = "Computational Thinking"
code = "CM6111"
credits = 20
print(credits)
from nose.tools import assert_equal
assert isinstance(name, str)
assert isinstance(code, str)
assert isinstance(credits, int)
assert_equal(credits, 20)
assert_equal(code, "CM6111")
assert_equal(name, "Computational Thinking")
"""
Explanation... |
tomkralidis/OWSLib | notebooks/examples/wms.ipynb | bsd-3-clause | from owslib.wms import WebMapService
wms_url = "https://ows.terrestris.de/osm/service"
wms = WebMapService(wms_url, version="1.3.0")
print(f"WMS version: {wms.identification.version}")
print(f"WMS title: {wms.identification.title}")
print(f"WMS abstract: {wms.identification.abstract}")
print(f"Provider name: {wms.pr... |
guyk1971/deep-learning | intro-to-rnns/Anna_KaRNNa_exercise_orig.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, we'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is bas... |
yw-fang/readingnotes | abinitio/aiida/aiida-v0.11.0-updated-note.ipynb | apache-2.0 | conda create -n aiida python=2.7 #set a veritual environment
conda activate aiida
#sometimes in mac, such a command might be requested
sudo ln -s /Users/ywfang/miniconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh
conda install postgresql
"""
Explanation: Aiida and the aiida-plugins
1. aiida-v0.11.0 installation... |
eshlykov/mipt-day-after-day | statistics/python/python_5.ipynb | unlicense | import numpy as np
"""
Explanation: Кафедра дискретной математики МФТИ
Курс математической статистики
Никита Волков
На основе http://www.inp.nsk.su/~grozin/python/
Библиотека numpy
Пакет numpy предоставляет $n$-мерные однородные массивы (все элементы одного типа); в них нельзя вставить или удалить элемент в произвольн... |
dkirkby/quantum-demo | jupyter/InfiniteSquareWell.ipynb | mit | %pylab inline
import matplotlib.animation
from IPython.display import HTML
import scipy.fftpack
"""
Explanation: One-Dimensional Infinite Square Well
End of explanation
"""
def calculate(initial, nx=100, nt=10, quantum=True):
"""Solve the 1D classical or quantum wave equation with fixed endpoints.
Pa... |
ueapy/ueapy.github.io | content/notebooks/2016-01-29-matplotlib-styles.ipynb | mit | import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
plt.title('This is my title', fontsize=20)
"""
Explanation: One of the main applications of Python among the members of our group is, admittedly, visualising data in pulication-quality figures. This was the topic for today's meeting and we w... |
kadrlica/ugali | notebooks/isochrone_example.ipynb | mit | def plot_iso(iso):
plt.scatter(iso.mag_1-iso.mag_2,iso.mag_1+iso.distance_modulus,marker='o',c='k')
plt.gca().invert_yaxis()
plt.xlabel('%s - %s'%(iso.band_1,iso.band_2)); plt.ylabel(iso.band_1)
iso1 = isochrone.factory(name='Padova',
age=12, # Gyr
metallici... |
metpy/MetPy | v0.4/_downloads/Station_Plot.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as feat
import matplotlib.pyplot as plt
import numpy as np
from metpy.calc import get_wind_components
from metpy.cbook import get_test_data
from metpy.plots import StationPlot
from metpy.plots.wx_symbols import current_weather, sky_cover
from metpy.units import units
... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/official/automl/sdk_automl_text_entity_extraction_online.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex AI SDK for Python: AutoML training text entity extraction model for online prediction
<t... |
csaladenes/blog | airports/airportia_hu_dest_parser.ipynb | mit | for i in locations:
print i
if i not in sch:sch[i]={}
#march 11-24 = 2 weeks
for d in range (11,25):
if d not in sch[i]:
try:
url=airportialinks[i]
full=url+'departures/201703'+str(d)
m=requests.get(full).content
sch[i][... |
jrrickerson/scroller | Scroller Game Tutorial.ipynb | mit | !python kivy/examples/tutorials/pong/main.py
"""
Explanation: SCROLLER GAME TUTORIAL
This tutorial will teach you how to build a basic side scrolling game with Python and Kivy. You will start out by displaying a few basic shapes on the screen, then adding some of the game mechanics, handling user input, and then fina... |
eaton-lab/toytree | docs/NodeLabels.ipynb | bsd-3-clause | import toytree
import toyplot
import numpy as np
# newick tree string with edge lengths and support values
newick = """
((apple:2,orange:4)100:2,(((tomato:2,eggplant:1)100:2,pepper:3)90:1,tomatillo:2)100:1);
"""
# load toytree
tre = toytree.tree(newick)
"""
Explanation: Node labels
Node labels are markers plotted on... |
leriomaggio/python-in-a-notebook | 01 Introducing the IPython Notebook.ipynb | mit | # This is a code cell made up of Python comments
# We can execute it by clicking on it with the mouse
# then clicking the "Run Cell" button
# A comment is a pretty boring piece of code
# This code cell generates "Hello, World" when executed
print("Hello, World")
# Code cells can also generate graphical output
%matpl... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.has_bounded_lag.ipynb | gpl-3.0 | import vcsn
ctx = vcsn.context("lat<lan_char(ab), lan_char(xy)>, b")
ctx
a = ctx.expression(r"'a,x''b,y'*'a,\e'").automaton()
a
"""
Explanation: automaton.has_bounded_lag
Check if the transducer has bounded lag, i.e. that the difference of length between the input and output words is bounded, for every word accepted.... |
IanHawke/ET-NumericalMethods-2016 | slides/03-hyperbolic-pdes.ipynb | mit | import numpy
from matplotlib import pyplot
%matplotlib inline
def RHS(U, dx):
"""
RHS term.
Parameters
----------
U : array
contains [phi, phi_t, phi_x] at each point
dx : double
grid spacing
Returns
-------
dUdt : array
contains the r... |
tpin3694/tpin3694.github.io | sql/dates_and_times.ipynb | mit | # Ignore
%load_ext sql
%sql sqlite://
%config SqlMagic.feedback = False
"""
Explanation: Title: Dates And Times
Slug: dates_and_times
Summary: Dates and times in SQL.
Date: 2016-05-01 12:00
Category: SQL
Tags: Basics
Authors: Chris Albon
Note: This tutorial was written using Catherine Devlin's SQL in Jupyter Notebo... |
matt-graham/auxiliary-pm-mcmc | experiment_notebooks/Analyse results.ipynb | mit | import rpy2.interactive as r
import rpy2.interactive.packages
r.packages.importr("coda")
rlib = r.packages.packages
"""
Explanation: Load python R interface and import coda for computing chain statistics
End of explanation
"""
def to_precision(x, p):
p_str = str(p)
fmt_string = '{0:.' + p_str + 'g}'
retu... |
rmoehn/cartpole | notebooks/StatsExperiments.ipynb | mit | from mpl_toolkits.mplot3d import Axes3D
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
import numpy.ma as ma
import sys
sys.path.append("..")
from hiora_cartpole import interruptibility
import saveloaddata
import stats_experiments
import stats_experiments as se
data_dir_p = "../data"
"""
E... |
pacificclimate/pycds | scripts/Demo.ipynb | gpl-3.0 | import datetime
from pycds import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import and_, or_
"""
Explanation: Using the PyCDS package as an interface to the Provincial Climate Data Set database
End of explanation
"""
connection_string = 'postgresql+psycopg2://hie... |
dariox2/CADL | session-1/.ipynb_checkpoints/lecture-1-checkpoint.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
"""
Explanation: Session 1: Introduction to Tensorflow
<p class='lead'>
Creative Applications of Deep Learning with Tensorflow<br />
Parag K. Mital<br />
Kadenze, Inc.<br />
</p>
<a name="learning-goals"></a>
Learning Goals
... |
cogeorg/black_rhino | examples/degroot/Run_deGroot.ipynb | gpl-3.0 | environment_directory = "configs/environments/"
identifier = "test_degroot"
log_directory = "log/"
"""
Explanation: Running the deGroot Model
First, the model needs to be initialized.
End of explanation
"""
if not os.path.exists('log'):
os.makedirs('log')
# logging.basicConfig(format='%(asctime)s %(message)s', ... |
ajmendez/explore | cupid/age.ipynb | mit | %matplotlib inline
import time
import pylab
import numpy as np
import pandas as pd
import seaborn as sns
sns.set_style('white')
from pysurvey.plot import setup_sns as setup
from pysurvey.plot import density, icolorbar, text, legend, outline
people = pd.read_csv('/Users/ajmendez/data/okcupid/random_v4.csv')
people = p... |
tensorflow/docs-l10n | site/zh-cn/tutorials/estimator/boosted_trees.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... |
science-of-imagination/nengo-buffer | Project/trained_mental_manipulations_ens_inhibition.ipynb | gpl-3.0 | import nengo
import numpy as np
import cPickle
from nengo_extras.data import load_mnist
from nengo_extras.vision import Gabor, Mask
from matplotlib import pylab
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from scipy import linalg
"""
Explanation: Using the trained weights in an ensemble of... |
statkclee/ThinkStats2 | code/chap10soln-kor.ipynb | gpl-3.0 | import brfss
import numpy as np
%matplotlib inline
df = brfss.ReadBrfss(nrows=None)
df = df.dropna(subset=['htm3', 'wtkg2'])
heights, weights = df.htm3, df.wtkg2
weights = np.log10(weights)
"""
Explanation: 통계적 사고 (2판) 연습문제 (thinkstats2.com, think-stat.xwmooc.org)<br>
Allen Downey / 이광춘(xwMOOC)
연습문제 10.1
BRFSS에서 나온 ... |
yhilpisch/ipynb-docker | jupserver/ipynbs/interactive.ipynb | bsd-3-clause | from IPython.html.widgets import *
import matplotlib as mpl
mpl.use('agg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
import numpy as np
class call_option(object):
from math import log, sqrt, exp
from scipy import stats
global log, sqrt, exp, stats
... |
gabrielrezzonico/dogsandcats | notebooks/01. Data loading and analysis.ipynb | mit | plot_grid(imgs, titles=labels)
%autosave 0
"""
Explanation: Samples
End of explanation
"""
import pandas as pd
import glob
from PIL import Image
files = glob.glob(ORIGINAL_TRAIN_DIRECTORY + '*')
df = pd.DataFrame({'fpath':files,'width':0,'height':0})
df['category'] = df.fpath.str.extract('../data/original_train/([... |
ES-DOC/esdoc-jupyterhub | notebooks/pcmdi/cmip6/models/sandbox-1/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: PCMDI
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turb... |
deepfield/ibis | docs/source/notebooks/tutorial/3-Projection-Join-Sort.ipynb | apache-2.0 | import ibis
import os
hdfs_port = os.environ.get('IBIS_WEBHDFS_PORT', 50070)
hdfs = ibis.hdfs_connect(host='quickstart.cloudera', port=hdfs_port)
con = ibis.impala.connect(host='quickstart.cloudera', database='ibis_testing',
hdfs_client=hdfs)
print('Hello!')
"""
Explanation: Projection, Joini... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_linear_model_patterns.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Romain Trachel <trachelr@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io
from mne.datasets import sample
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
# impor... |
qkitgroup/qkit | qkit/doc/notebooks/Sample_Class.ipynb | gpl-2.0 | import qkit
qkit.cfg['datadir'] = r'c:\data'
qkit.cfg['run_id'] = 'Run0'
qkit.cfg['user'] = 'qkit_user'
import qkit.measure.samples_class as sc
demo = sc.Sample()
"""
Explanation: Qkit Sample Objects
The sample objects are very general and basic objects in qkit. They can be used to store any parameters of your curre... |
Kappa-Dev/ReGraph | examples/Tutorial_Neo4j_backend/Part2_hierarchies.ipynb | mit | from regraph import NXGraph, Neo4jHierarchy, Rule
from regraph import plot_graph, plot_instance, plot_rule
%matplotlib inline
"""
Explanation: ReGraph tutorial (Neo4j backend)
Part 2: Rewriting hierarchies of graph
ReGraph allows to create a hierarchies of graphs related by means of homomorphisms (or typing). In the ... |
tpin3694/tpin3694.github.io | machine-learning/recursive_feature_elimination.ipynb | mit | # Load libraries
from sklearn.datasets import make_regression
from sklearn.feature_selection import RFECV
from sklearn import datasets, linear_model
import warnings
# Suppress an annoying but harmless warning
warnings.filterwarnings(action="ignore", module="scipy", message="^internal gelsd")
"""
Explanation: Title: R... |
kit-cel/wt | nt2_ce2/vorlesung/ch_4_diversity/detection_Rn.ipynb | gpl-2.0 | # importing
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 30}
plt.rc('font', **font)
#plt.rc('text', usetex=True)
matplotlib.rc('figure', figsize=(30, 12) )
"""
Explanation: Content and... |
jeffzhengye/pylearn | pybasic/.ipynb_checkpoints/基本操作实例-checkpoint.ipynb | unlicense | from pathlib import Path
import pathlib
save_dir = "./test_dir"
Path(save_dir).mkdir(parents=True, exist_ok=True)
### get current directory
print(Path.cwd())
print(Path.home())
print(pathlib.Path.home().joinpath('python', 'scripts', 'test.py'))
"""
Explanation: 文件系统相关操作
pathlib
The pathlib module was introduced ... |
finklabs/loganalyser | demo2_experiments.ipynb | mit | %matplotlib inline
import pandas as pd
from korg import korg
from korg.pattern import PatternRepo
import tarfile
from loganalyser import plot
"""
Explanation: moving the work to jupyter
This notebook demonstrates the use of single-line calls to D3 visualizations via the simple d3_lib.py file and referenced css and js... |
bioinf-jku/SNNs | TF_1_x/getSELUparameters.ipynb | gpl-3.0 | import numpy as np
from scipy.special import erf,erfc
from sympy import Symbol, solve, nsolve
"""
Explanation: Obtain the SELU parameters for arbitrary fixed points
Author: Guenter Klambauer, 2017
End of explanation
"""
def getSeluParameters(fixedpointMean=0,fixedpointVar=1):
""" Finding the parameters of the SE... |
sofmonk/aima-python | grid.ipynb | mit | import math
def distance(a, b):
"""The distance between two (x, y) points."""
return math.hypot((a[0] - b[0]), (a[1] - b[1]))
"""
Explanation: Grid
The functions here are used often when dealing with 2D grids (like in TicTacToe).
Distance
The function returns the Euclidean Distance between two points in the 2... |
davidgutierrez/HeartRatePatterns | Jupyter/plot_compare_reduction.ipynb | gpl-3.0 | # Authors: Robert McGibbon, Joel Nothman, Guillaume Lemaitre
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_digits
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.svm import Linear... |
juanshishido/okcupid | main.ipynb | mit | import pickle
import warnings
from utils.hash import make
from utils.calculate_pmi_features import *
from utils.clean_up import *
from utils.categorize_demographics import *
from utils.reduce_dimensions import run_kmeans
from utils.nonnegative_matrix_factorization import nmf_inspect, nmf_labels
warnings.filterwarnings... |
dfm/dfm.io | static/downloads/notebooks/pymc-tensorflow.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = "retina"
from matplotlib import rcParams
rcParams["savefig.dpi"] = 100
rcParams["figure.dpi"] = 100
rcParams["font.size"] = 20
"""
Explanation: Title: PyMC3 + TensorFlow
Date: 2018-08-02
Category: Data Analysis
Slug: pymc-tensorflow
Summary: the most ambitious ... |
tensorflow/docs-l10n | site/zh-cn/guide/data_performance.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... |
Olsthoorn/IHE-python-course-2017 | exercises/Mar07/dealingWithStrings.ipynb | gpl-2.0 | from pprint import pprint
s1 = 'This is a string'
s2 ="This too is a ; the `quotes` don't matter as long as your are consequent you can use quotes inside quotes"
s3 = """This is a multiline
string, mostly used for doc
strings in fucntions and classes
"""
print(s1)
print(s2)
print()
print(s3)
"""
Explanation: <figur... |
kubeflow/kfserving-lts | docs/samples/client/kfserving_sdk_v1beta1_sample.ipynb | apache-2.0 | from kubernetes import client
from kfserving import KFServingClient
from kfserving import constants
from kfserving import utils
from kfserving import V1beta1InferenceService
from kfserving import V1beta1InferenceServiceSpec
from kfserving import V1beta1PredictorSpec
from kfserving import V1beta1TFServingSpec
"""
Expl... |
robblack007/clase-metodos-numericos | Practicas/P4/Practica 4 - Sistemas de ecuaciones lineales II.ipynb | mit | from numpy import matrix
A = matrix([[72, 0, 0, 9, 0, 0],
[ 0, 2.88, 0, 0, 0, -4.5],
[ 0, 0, 18, 9, 0, 0],
[ 9, 0, 9, 12, 0, 0],
[ 0, 0, 0, 0, 33, 0],
[ 0, -4.5, 0, 0, 0, 33]])
b = matrix([[2],
[0.5],
... |
schaber/deep-learning | autoencoder/Simple_Autoencoder.ipynb | mit | %matplotlib inline
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', validation_size=0)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
kit-cel/lecture-examples | nt1/vorlesung/9_mimo/mimo.ipynb | gpl-2.0 | # importing
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 30}
plt.rc('font', **font)
plt.rc('text', usetex=matplotlib.checkdep_usetex(True))
matplotlib.rc('figure', figsize=(18, 8))
"""
Explanation: Content an... |
StudyExchange/Udacity | MachineLearning(Advanced)/p0_titanic_survival_exploration/titanic_survival_exploration.ipynb | mit | import numpy as np
import pandas as pd
# RMS Titanic data visualization code
# 数据可视化代码
from titanic_visualizations import survival_stats
from IPython.display import display
%matplotlib inline
# Load the dataset
# 加载数据集
in_file = 'titanic_data.csv'
full_data = pd.read_csv(in_file)
# Print the first few entries of t... |
smenon8/AnimalWildlifeEstimator | Notebooks/.ipynb_checkpoints/AppendMicrosoftAIData-checkpoint.ipynb | bsd-3-clause | import csv
import json
import JobsMapResultsFilesToContainerObjs as ImageMap
import DeriveFinalResultSet as drs
import DataStructsHelper as DS
import importlib
import pandas as pd
import htmltag as HT
from collections import OrderedDict
#import matplotlib.pyplot as plt
import plotly.plotly as py
import cufflinks as cf ... |
jhillairet/scikit-rf | doc/source/examples/interactive/Interactive Mismatched Line.ipynb | bsd-3-clause | from IPython.display import YouTubeVideo
YouTubeVideo('JyYi_1SswXs',width=700, height=580)
from ipywidgets import interact
%matplotlib inline
from pylab import *
from skrf.media import DistributedCircuit
from skrf import Frequency
import skrf as rf
rf.stylely()
# define a frequency object
freq = Frequency(0,10... |
FZJ-IEK3-VSA/tsam | examples/example_k_maxoids.ipynb | mit | %load_ext autoreload
%autoreload 2
import copy
import os
import pandas as pd
import matplotlib.pyplot as plt
import tsam.timeseriesaggregation as tsam
%matplotlib inline
"""
Explanation: tsam - 1. Example
Example usage of the time series aggregation module (tsam)
Date: 02.05.2020
Author: Maximilian Hoffmann
Import pan... |
mined-gatech/pymks_overview | notebooks/checker_board.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Checkerboard Microstructure
Introduction - What are 2-Point Spatial Correlations (also called 2-Point Statistics)?
The purpose of this example is to introduce 2-point spatial correlations and how... |
gboeing/urban-data-science | modules/08-urban-networks-ii/process-lodes.ipynb | mit | import geopandas as gpd
import osmnx as ox
import pandas as pd
from shapely.geometry import Point
"""
Explanation: This notebook merges LODES home/work locations with census blocks to get home/work lat-lng block coordinates.
Data sources:
- 2018 LEHD LODES: https://lehd.ces.census.gov/data/
- 2020 Census blocks: h... |
lionell/university-labs | num_methods/second/lab2.ipynb | mit | def euler(f, x, y0):
h = x[1] - x[0]
y = np.empty_like(x)
y[0] = y0
for i in range(1, len(x)):
y[i] = y[i - 1] + h * f(x[i - 1], y[i - 1])
return y
"""
Explanation: Ordinary differential equations
Euler method
End of explanation
"""
dy = lambda x, y: x*x + y*y
x = np.linspace(0, 0.5, 100... |
ga7g08/ga7g08.github.io | _notebooks/2015-12-03-Hierarchical-Linear-Regression-Models-In-PyMC3-Multiple-Responces.ipynb | mit | Nrespondants = 5
Nresponces = 10
a_val = 45
mu_b_val = 0.1
sigma_b_val = 3
b = np.random.normal(mu_b_val, sigma_b_val, Nrespondants)
xobs_stacked = np.random.uniform(0, 10, (Nresponces, Nrespondants))
yobs_stacked = a_val + b * xobs_stacked + np.random.normal(0, 1.0, (Nresponces, Nrespondants))
plt.plot(xobs_stacke... |
mne-tools/mne-tools.github.io | 0.21/_downloads/5514ea6c90dde531f8026904a417527e/plot_10_evoked_overview.ipynb | bsd-3-clause | import os
import mne
"""
Explanation: The Evoked data structure: evoked/averaged data
This tutorial covers the basics of creating and working with :term:evoked
data. It introduces the :class:~mne.Evoked data structure in detail,
including how to load, query, subselect, export, and plot data from an
:class:~mne.Evoked ... |
bgroveben/python3_machine_learning_projects | backpropagation_from_scratch/backpropagation_from_scratch.ipynb | mit | import pandas as pd
seeds_dataset = pd.read_csv('seeds_dataset.csv', header=None)
"""
Explanation: How to Implement the Backpropagation Algorithm From Scratch In Python
[Courtesy of Jason Brownlee at Machine Learning Mastery. Thanks Jason!
Description
This section provides a brief introduction to the Backpropagation ... |
BeatHubmann/17F-U-DLND | 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... |
enchantner/python-zero | lesson_7/Slides.ipynb | mit | import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute("""
CREATE TABLE employees (
id int unsigned NOT NULL,
first_name string NOT NULL,
last_name string NOT NULL,
department_id int unsigned,
PRIMARY KEY (id)
)""")
c.execute("""
CREATE TABLE departments (
id int unsigned NOT NULL,... |
JackDi/phys202-2015-work | assignments/assignment05/InteractEx03.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 3
Imports
End of explanation
"""
import math
def soliton(x, t, c, a):
"""Return phi(x, t) for a soliton... |
Jay-Oh-eN/data-science-workshops | modeling_data.ipynb | mit | import pandas as pd
import matplotlib as plt
# draw plots in notebook
%matplotlib inline
# make plots SVG (higher quality)
%config InlineBackend.figure_format = 'svg'
# more time/compute intensive to parse dates. but we know we definitely have/need them
df = pd.read_csv('data/sf_listings.csv', parse_dates=['last_rev... |
christinahedges/PyKE | docs/source/tutorials/ipython_notebooks/whatsnew31.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from pyke.utils import module_output_to_channel, channel_to_module_output
module_output_to_channel(module=19, output=3)
channel_to_module_output(67)
"""
Explanation: What's new in PyKE 3.1?
Utility functions
PyKE has included two convinience functions to convert be... |
setiQuest/ML4SETI | tutorials/Step_5d_Build_CNN_Tf_PowerAI.ipynb | apache-2.0 | import requests
import json
#import ibmseti
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import tensorflow as tf
import pickle
import time
#!sudo pip install sklearn
import os
from sklearn.metrics import confusion_matrix
from sklearn import metrics
"""
Explanation: <a href="https://www.cogniti... |
turbomanage/training-data-analyst | blogs/babyweight/babyweight.ipynb | apache-2.0 | %%bash
pip install --upgrade tensorflow==1.4
pip install --ignore-installed --upgrade pytz==2018.4
pip uninstall -y google-cloud-dataflow
pip install --upgrade apache-beam[gcp]==2.6
"""
Explanation: <h1> Structured data prediction using Cloud ML Engine </h1>
This notebook illustrates:
<ol>
<li> Exploring a BigQuery d... |
QuantCrimAtLeeds/PredictCode | examples/Scripts/Reload stscan predictions.ipynb | artistic-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import open_cp.scripted
import open_cp.scripted.analysis as analysis
loaded = open_cp.scripted.Loader("stscan_preds.pic.xz")
loaded.timed_points.time_range
fig, axes = plt.subplots(ncols=2, figsize=(16,7))
analysis.plot_data_scatter(loaded, axes[0])
analysis.plot_da... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.