repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
statsmodels/statsmodels.github.io
v0.13.1/examples/notebooks/generated/stationarity_detrending_adf_kpss.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd import statsmodels.api as sm """ Explanation: Stationarity and detrending (ADF/KPSS) Stationarity means that the statistical properties of a time series i.e. mean, variance and covariance do not change over time. Many statistical...
AtmaMani/pyChakras
udemy_ml_bootcamp/Python-for-Data-Analysis/Pandas/Pandas Exercises/SF Salaries Exercise.ipynb
mit
import pandas as pd """ Explanation: <a href='http://www.pieriandata.com'> <img src='../../Pierian_Data_Logo.png' /></a> SF Salaries Exercise Welcome to a quick exercise for you to practice your pandas skills! We will be using the SF Salaries Dataset from Kaggle! Just follow along and complete the tasks outlined in b...
cathalmccabe/PYNQ
boards/Pynq-Z2/logictools/notebooks/pattern_generator_and_trace_analyzer.ipynb
bsd-3-clause
from pynq.overlays.logictools import LogicToolsOverlay logictools_olay = LogicToolsOverlay('logictools.bit') """ Explanation: Pattern Generator and Trace Analyzer This notebook will show how to use the Pattern Generator to generate patterns on I/O pins. The pattern that will be generated is 3-bit up count performed 4...
dereneaton/ipyrad
newdocs/API-analysis/cookbook-treemix-ipcoal.ipynb
gpl-3.0
# conda install treemix ipyrad ipcoal -c conda-forge -c bioconda import ipyrad.analysis as ipa import toytree import toyplot import ipcoal print('ipyrad', ipa.__version__) print('toytree', toytree.__version__) ! treemix --version | grep 'TreeMix v. ' """ Explanation: <h1><span style="color:gray">ipyrad-analysis tool...
metpy/MetPy
v1.0/_downloads/bb9caa5586d62e19ca46e30c02d29b43/Station_Plot.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt from metpy.calc import reduce_point_density from metpy.cbook import get_test_data from metpy.io import metar from metpy.plots import add_metpy_logo, current_weather, sky_cover, StationPlot """ Explanation: Station Plot Make ...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_maxwell_filter.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Mark Wronkiewicz <wronk.mark@gmail.com> # # License: BSD (3-clause) import mne from mne.preprocessing import maxwell_filter print(__doc__) data_path = mne.datasets.sample.data_path() "...
tkurfurst/deep-learning
reinforcement/Q-learning-cart.ipynb
mit
import gym import tensorflow as tf import numpy as np """ Explanation: Deep Q-learning In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p...
OceanPARCELS/parcels
parcels/examples/documentation_unstuck_Agrid.ipynb
mit
import numpy as np import numpy.ma as ma from netCDF4 import Dataset import xarray as xr from scipy import interpolate from parcels import FieldSet, ParticleSet, JITParticle, ScipyParticle, AdvectionRK4, Variable, Field,GeographicPolar,Geographic from datetime import timedelta as delta import matplotlib.pyplot as plt...
mari-linhares/tensorflow-workshop
code_samples/StructuredDataExample/automobile.ipynb
apache-2.0
from __future__ import print_function from __future__ import division from __future__ import absolute_import # We're using pandas to read the CSV file. This is easy for small datasets, but for large and complex datasets, # tensorflow parsing and processing functions are more powerful import pandas as pd import numpy a...
rishuatgithub/MLPy
torch/PYTORCH_NOTEBOOKS/00-Crash-Course-Topics/00-Crash-Course-NumPy/02-NumPy-Operations.ipynb
apache-2.0
import numpy as np arr = np.arange(0,10) arr arr + arr arr * arr arr - arr # This will raise a Warning on division by zero, but not an error! # It just fills the spot with nan arr/arr # Also a warning (but not an error) relating to infinity 1/arr arr**3 """ Explanation: <a href='http://www.pieriandata.com'><img ...
awsteiner/o2sclpy
doc/static/examples/interp.ipynb
gpl-3.0
import o2sclpy import matplotlib.pyplot as plot import sys import math import numpy from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import RBF, ConstantKernel plots=True if 'pytest' in sys.modules: plots=False """ Explanation: O$_2$scl interpolation example for ...
AllenDowney/ThinkBayes2
examples/game_of_ur_soln.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' from thinkbayes2 import Pmf, Cdf, Suite import thinkplot """ Explanation: Think Bayes This notebook pres...
phoebe-project/phoebe2-docs
2.2/tutorials/irrad_method_horvat.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Lambert Scattering (irrad_method='horvat') Setup Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """...
kylepjohnson/notebooks
public_talks/2016_10_26_harvard/3.1b Classification, extract features, fewer epithets.ipynb
mit
from cltk.corpus.greek.tlg.parse_tlg_indices import get_epithet_index import pandas epithet_frequencies = [] for epithet, _ids in get_epithet_index().items(): epithet_frequencies.append((epithet, len(_ids))) df = pandas.DataFrame(epithet_frequencies) df.sort_values(1, ascending=False) """ Explanation: Problem of ...
adityaka/misc_scripts
python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_04/Final/.ipynb_checkpoints/Missing Data-checkpoint.ipynb
bsd-3-clause
browser_index = ['Firefox', 'Chrome', 'Safari', 'IE10', 'Konqueror'] browser_df = pd.DataFrame({ 'http_status': [200,200,404,404,301], 'response_time': [0.04, 0.02, 0.07, 0.08, 1.0]}, index=browser_index) browser_df """ Explanation: Missing Data pandas uses np.nan to represent missing data. By defa...
sarathid/Learning
Deep_learning_ND/tv-script-generation/dlnd_tv_script_generation.ipynb
gpl-3.0
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
sastels/Onboarding
4 - Sorting.ipynb
mit
a = [5, 1, 4, 3] print sorted(a) print a """ Explanation: Sorting The easiest way to sort is with the sorted(list) function, which takes a list and returns a new list with those elements in sorted order. The original list is not changed. End of explanation """ strs = ['aa', 'BB', 'zz', 'CC'] print sorted(strs) print...
rjdkmr/do_x3dna
docs/notebooks/helical_steps_tutorial.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import dnaMD %matplotlib inline """ Explanation: Analysis of local helical parameters This tutorial discuss the analyses that can be performed using the dnaMD Python module included in the do_x3dna package. The tutorial is prepared using Jupyter Notebook and this n...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_lcmv_beamformer.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) # sphinx_gallery_thumbnail_number = 3 import matplotlib.pyplot as plt import numpy as np import mne from mne.datasets import sample from mne.beamformer import make_lcmv, apply_lcmv print(__doc__) data_path = sample.d...
awagner-mainz/notebooks
gallery/textreuse_mainz_2020/12000-segment-paragraphs.ipynb
mit
import os import lxml from lxml import etree resolved_dir = "./data/processing/10000_resolved" # we create a dictionary with our editions: resolved = { os.path.basename(file).split(os.extsep)[0] : (etree.parse(resolved_dir + "/" + file)) for file in sorted(os.listdir(resolved_dir...
zczapran/datascienceintensive
data_wrangling_json/sliderule_dsi_json_exercise.ipynb
mit
import pandas as pd """ Explanation: JSON examples and exercise get familiar with packages for dealing with JSON study examples with JSON strings and files work on exercise to be completed and submitted reference: http://pandas.pydata.org/pandas-docs/stable/io.html#io-json-reader data source: http://jsonstudio....
feststelltaste/software-analytics
prototypes/Reading Git logs with Pandas 2.0-checkpoint.ipynb
gpl-3.0
import git GIT_LOG_FILE = r'${REPO}/spring-petclinic' repo = git.Repo(GIT_LOG_FILE) git_bin = repo.git git_bin """ Explanation: Context In https://www.feststelltaste.de/reading-a-git-log-file-output-with-pandas/ I show you a way to read in Git log data with Pandas's DataFrame and GitPython. Looking back, this was re...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/cmip6/models/giss-e2-1h/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nasa-giss', 'giss-e2-1h', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: NASA-GISS Source ID: GISS-E2-1H Topic: Atmoschem Sub-Topics: Transport...
mne-tools/mne-tools.github.io
stable/_downloads/aec45e1f20057e833cee12bb6bd292dc/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 ...
GoogleCloudPlatform/asl-ml-immersion
notebooks/ml_fairness_explainability/explainable_ai/solutions/xai_structured_caip.ipynb
apache-2.0
import os PROJECT_ID = "" # TODO: your PROJECT_ID here. os.environ["PROJECT_ID"] = PROJECT_ID BUCKET_NAME = PROJECT_ID # TODO: replace your BUCKET_NAME, if needed REGION = "us-central1" os.environ["BUCKET_NAME"] = BUCKET_NAME os.environ["REGION"] = REGION """ Explanation: AI Explanations: Explaining a tabular dat...
planetlabs/notebooks
jupyter-notebooks/data-api-tutorials/search_and_download_quickstart.ipynb
apache-2.0
# Stockton, CA bounding box (created via geojson.io) geojson_geometry = { "type": "Polygon", "coordinates": [ [ [-121.59290313720705, 37.93444993515032], [-121.27017974853516, 37.93444993515032], [-121.27017974853516, 38.065932950547484], [-121.59290313720705, 38.065932950547484], ...
bjshaw/phys202-2015-work
project/NeuralNetworks.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from IPython.html.widgets import interact from sklearn.datasets import load_digits digits = load_digits() print(digits.data.shape) def show_digit(i): plt.matshow(digits.images[i]); interact(show_digit, i=(0,100)); """ Explanation: Neural Networks This project w...
elect000/Journal
value-tracker/report/report.ipynb
bsd-3-clause
import quandl data = quandl.get('NIKKEI/INDEX') data[:5] data_normal = (((data['Close Price']).to_frame())[-10000:-1])['Close Price'] data_normal[-10:-1] # 最新のデータ10件を表示 """ Explanation: データの取得方法 ここではQuandl.comからのデータを受け取っています。今回入手した日経平均株価は、 時間、開始値、最高値、最低値、終値のデータを入手していますが、古いデータは終値しかないようですので、終値を用います。 *** TODO いつからデータを入...
staeiou/github-analytics
github-organizations-intro.ipynb
mit
!pip install pygithub !pip install geopy !pip install ipywidgets from github import Github #this is my private login credentials, stored in ghlogin.py import ghlogin g = Github(login_or_token=ghlogin.gh_user, password=ghlogin.gh_passwd) """ Explanation: Querying the GitHub API for repositories and organizations By...
SKA-ScienceDataProcessor/crocodile
examples/notebooks/grid-predict.ipynb
apache-2.0
theta = 0.1 lam = 18000 grid_size = int(theta * lam) def kernel_oversample(ff, Qpx, s=None, P = 1): """ Takes a farfield pattern and creates an oversampled convolution function. If the far field size is smaller than N*Qpx, we will pad it. This essentially means we apply a sinc anti-aliasing kernel...
xesscorp/skidl
examples/skidl_spice_test/skidl_2_pyspice_check.ipynb
mit
from skidl.pyspice import * from PySpice.Spice.Netlist import Circuit """ Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Checking-tool" data-toc-modified-id="Checking-tool-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Checking tool</a>...
DOV-Vlaanderen/pydov
docs/notebooks/search_lithologische_beschrijvingen.ipynb
mit
%matplotlib inline import os, sys import inspect import pydov """ Explanation: Example of DOV search methods for lithologische beschrijvingen Use cases: Select records in a bbox Select records in a bbox with selected properties Select records in a municipality Get records using info from wfs fields, not available i...
cmshobe/landlab
notebooks/tutorials/overland_flow/overland_flow_driver.ipynb
mit
from landlab.components.overland_flow import OverlandFlow from landlab.plot.imshow import imshow_grid from landlab.plot.colors import water_colormap from landlab import RasterModelGrid from landlab.io.esri_ascii import read_esri_ascii from matplotlib.pyplot import figure import numpy as np from time import time %matplo...
lneuhaus/pyrpl
docs/example-notebooks/tutorial.ipynb
mit
import pyrpl print(pyrpl.__file__) """ Explanation: Introduction to pyrpl 1) Introduction The RedPitaya is an affordable FPGA board with fast analog inputs and outputs. This makes it interesting also for quantum optics experiments. The software package PyRPL (Python RedPitaya Lockbox) is an implementation of many devi...
moble/PostNewtonian
C++/TestBackwardsEvolution.ipynb
mit
v_i = 0.15 m1 = 0.4 m2 = 0.6 chi1_i = [0.1,0.2,0.3] chi2_i = [0.2,0.3,0.4] R_frame_i = Quaternions.Quaternion(1,0,0,0) ForwardInTime = True v_0 = 0.9*v_i tA,vA,chi1A,chi2A,R_frameA,PhiA = \ PNEvolution.EvolvePN("TaylorT1", 4.0, v_0, v_i, m1, m2, chi1_i, chi2_i, R_frame_i, ForwardInTime) plot(tA, vA, label='v_0 = {...
abulbasar/machine-learning
Scikit - 03 Linear Regression.ipynb
apache-2.0
df_null_idx = df[df.isnull().sum(axis = 1) > 0].index df.iloc[df_null_idx] median_values = df.groupby("State")[["R&D Spend", "Marketing Spend"]].median() median_values df["R&D Spend"] = df.apply(lambda row: median_values.loc[row["State"], "R&D Spend"] if np.isnan(row["R&D Spend"]) else row["R&D Spend"], axis = 1 ) d...
tanmay987/deepLearning
tv-script-generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scri...
IBMDecisionOptimization/docplex-examples
examples/mp/jupyter/sparktrans/SparkML_transformers_pipeline.ipynb
apache-2.0
try: import numpy as np except ImportError: raise RuntimError('This notebook requires numpy') """ Explanation: Embedding CPLEX in a ML Spark Pipeline Spark ML provides a uniform set of high-level APIs that help users create and tune practical machine learning pipelines. In this notebook, we show how to embed C...
GoogleCloudPlatform/training-data-analyst
self-paced-labs/vertex-ai/vertex-pipelines/tfx/lab_exercise.ipynb
apache-2.0
GOOGLE_CLOUD_PROJECT_ID = !(gcloud config get-value core/project) GOOGLE_CLOUD_PROJECT_ID = GOOGLE_CLOUD_PROJECT_ID[0] GOOGLE_CLOUD_REGION = 'us-central1' BQ_DATASET_NAME = 'chicago_taxifare_tips' BQ_TABLE_NAME = 'chicago_taxi_tips_ml' BQ_LOCATION = 'US' BQ_URI = f"bq://{GOOGLE_CLOUD_PROJECT_ID}.{BQ_DATASET_NAME}.{BQ...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160621화_18일차_QDALDA QuandraticLinear Discriminant Analysis/1.QDA and LDA.ipynb
mit
N = 100 np.random.seed(0) X1 = sp.stats.multivariate_normal([ 0, 0], [[0.7, 0],[0, 0.7]]).rvs(100) X2 = sp.stats.multivariate_normal([ 1, 1], [[0.8, 0.2],[0.2, 0.8]]).rvs(100) X3 = sp.stats.multivariate_normal([-1, 1], [[0.8, 0.2],[0.2, 0.8]]).rvs(100) y1 = np.zeros(N) y2 = np.ones(N) y3 = 2*np.ones(N) X = np.vstack([X...
PyPSA/PyPSA
examples/notebooks/simple-electricity-market-examples.ipynb
mit
import pypsa, numpy as np # marginal costs in EUR/MWh marginal_costs = {"Wind": 0, "Hydro": 0, "Coal": 30, "Gas": 60, "Oil": 80} # power plant capacities (nominal powers in MW) in each country (not necessarily realistic) power_plant_p_nom = { "South Africa": {"Coal": 35000, "Wind": 3000, "Gas": 8000, "Oil": 2000}...
w4zir/ml17s
assignments/.ipynb_checkpoints/assignment02-logistic-regression-and-neural-network-checkpoint.ipynb
mit
import cv2 img = cv2.imread('test.png',0) resized_image = cv2.resize(img, (28, 28), interpolation = cv2.INTER_AREA) """ Explanation: CSAL4243: Introduction to Machine Learning Muhammad Mudassir Khan (mudasssir.khan@ucp.edu.pk) Assignment 2: Digits Recognition using Logistic Regression & Neural Networks In this assign...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/automl/sdk_automl_video_object_tracking_batch.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 video object tracking model for batch prediction <tab...
ModestoCabrera/IS360_W7Assignment
Week7_Assignment.ipynb
gpl-2.0
import urllib2, argparse from bs4 import BeautifulSoup import pandas as pd link = "https://www.globalpolicy.org/component/content/article/109/27519.html" """ Explanation: Reading HTML Tables into DataFrame End of explanation """ from week_7_code import * """ Explanation: I'd previously coded this in a python fi...
Applied-Groundwater-Modeling-2nd-Ed/Chapter_5_problems-1
P5.3_Flopy_Industrial_pond.ipynb
gpl-2.0
%matplotlib inline import sys import os import shutil import numpy as np from subprocess import check_output # Import flopy import flopy """ Explanation: <img src="AW&H2015.tiff" style="float: left"> <img src="flopylogo.png" style="float: center"> Problem P5.3 Industrial Pond Leakage In Problem P5.3 from pag...
MBARIMike/biofloat
notebooks/build_biofloat_cache.ipynb
mit
from biofloat import ArgoData ad = ArgoData(verbosity=2) """ Explanation: Build local cache file from Argo data sources - first in a series of Notebooks Execute commands to pull data from the Internet into a local HDF cache file so that we can better interact with the data Import the ArgoData class and instatiate an A...
marknabil/B31XI-SI-Clustering
03-clustering.ipynb
gpl-2.0
%matplotlib inline %pprint off # Matplotlib library from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib.pyplot as plt # MPLD3 extension import mpld3 # Numpy library import numpy as np # Import the Scipy library for grid...
prasants/pyds
04.String_me_along.ipynb
mit
print("Hello World!") """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Strings" data-toc-modified-id="Strings-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Strings</a></div><div class="lev2 toc-item"><a href="#Switching-between-Single,-Double-and-Triple-Quotes" data-toc-modified-id="Switc...
mne-tools/mne-tools.github.io
0.24/_downloads/09a8b0bb7a57481cdd1f7832f0291ee6/brain.ipynb
bsd-3-clause
# Author: Alex Rockhill <aprockhill@mailbox.org> # # License: BSD-3-Clause """ Explanation: Plotting with mne.viz.Brain In this example, we'll show how to use :class:mne.viz.Brain. End of explanation """ import os.path as op import matplotlib.pyplot as plt import mne from mne.datasets import sample print(__doc__) ...
synthicity/activitysim
activitysim/examples/example_estimation/notebooks/15_non_mand_tour_freq.ipynb
agpl-3.0
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating Non-Mandatory Tour Frequency This notebook illustrates how to re-estimate a single model component for ActivitySim. This process includes running ActivitySim in estimation mode to read house...
yugangzhang/CHX_Pipelines
Working_Pipleines/XPCS_Single_2017_V8_debug.ipynb
bsd-3-clause
from chxanalys.chx_packages import * %matplotlib notebook plt.rcParams.update({'figure.max_open_warning': 0}) plt.rcParams.update({ 'image.origin': 'lower' }) plt.rcParams.update({ 'image.interpolation': 'none' }) import pickle as cpk from chxanalys.chx_xpcs_xsvs_jupyter_V1 import * Javascript( ''' var nb ...
ComputationalModeling/spring-2017-danielak
past-semesters/fall_2016/day-by-day/day17-analyzing-tweets-with-string-processing/In-Class-Strings-SOLUTION.ipynb
agpl-3.0
%matplotlib inline import matplotlib.pyplot as plt from string import punctuation """ Explanation: Day 17 In-class assignment: Data analysis and Modeling in Social Sciences Part 3 The first part of this notebook is a copy of a blog post tutorial written by Dr. Neal Caren (University of North Carolina, Chapel Hill). Th...
ctn-waterloo/best-practices
Confidence Intervals - bootstrap.ipynb
mit
%matplotlib inline import pylab import numpy as np """ Explanation: Confidence Intervals Purpose: take data from multiple runs and create aggregate data that is useful for drawing conclusions End of explanation """ rng = np.random.RandomState(seed=0) data = rng.normal(size=3) pylab.scatter(np.zeros_like(data), dat...
mroberge/hydrofunctions
docs/notebooks/Hydrofunctions_Comparing_Stream_Environments.ipynb
mit
import hydrofunctions as hf %matplotlib inline """ Explanation: Comparing Different Stream Environments This Jupyter Notebook compares four streams in different environments in the U.S. Using hydrofunctions, we are able to plot the flow duration graphs for all four streams and compare them. End of explanation """ s...
robertoalotufo/ia898
master/tutorial_img_ds.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np !ls ../data f = mpimg.imread('../data/cameraman.tif') print('Tamanho de f: ', f.shape) print('Tipo do pixel:', f.dtype) print('Número total de pixels:', f.size) print('Pixels:\n', f) """ Explanation: Table of Cont...
ChadFulton/statsmodels
examples/notebooks/statespace_concentrated_scale.ipynb
bsd-3-clause
import numpy as np import pandas as pd import statsmodels.api as sm dta = sm.datasets.macrodata.load_pandas().data dta.index = pd.PeriodIndex(start='1959Q1', end='2009Q3', freq='Q') """ Explanation: State space models - concentrating the scale out of the likelihood function End of explanation """ class LocalLevel(s...
tensorflow/docs-l10n
site/ko/guide/migrate.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...
deepmind/spurious_normativity
spurious_normativity_figures.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import pickle import scipy.stats import seaborn as sns import tempfile from google.colab import files import warnings warnings.simplefilter('ignore', category=RuntimeWarning) """ Explanation: Copyright 2021 DeepMind Technologies Limited. Licensed under the Apache Lice...
vbarua/PythonWorkshop
Code/Introduction To Python/1 - Strings, Numbers and Booleans.ipynb
mit
"This is a string!!!" 'This is also a string!!!' "This string contains single 'quotation' marks!!!" 'This string contains double "quotation" marks!!!' """ Explanation: Strings, Numbers and Booleans Strings Python has strings, which are written using either single or double quotes. End of explanation """ 7 42 ""...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session11/Day2/MeasuringCentroidsAndProperMotionSolutions.ipynb
mit
# Load the packages we will use import numpy as np import astropy.io.fits as pf import astropy.coordinates as co from astropy.wcs import WCS from matplotlib import pyplot as pl %matplotlib inline """ Explanation: Practice with stellar astrometry To accompany astrometry lecture from the Rubin Observatory Data Science F...
gcgruen/homework
foundations-homework/05/homework-05-gruen-nyt_graded.ipynb
mit
#API Key: 0c3ba2a8848c44eea6a3443a17e57448 """ Explanation: All API's: http://developer.nytimes.com/ Article search API: http://developer.nytimes.com/article_search_v2.json Best-seller API: http://developer.nytimes.com/books_api.json#/Documentation Test/build queries: http://developer.nytimes.com/ Tip: Remember to inc...
valentina-s/GLM_PythonModules
notebooks/MLE_multipleNeuronsWeights.ipynb
bsd-2-clause
import numpy as np import matplotlib.pyplot as plt import pandas as pd import random import csv %matplotlib inline import os import sys sys.path.append(os.path.join(os.getcwd(),'..')) sys.path.append(os.path.join(os.getcwd(),'..','code')) sys.path.append(os.path.join(os.getcwd(),'..','data')) import filters import li...
PMEAL/OpenPNM
examples/simulations/steady_state/continuum_heat_transfer.ipynb
mit
%matplotlib inline import numpy as np import scipy as sp import openpnm as op %config InlineBackend.figure_formats = ['svg'] np.random.seed(10) ws = op.Workspace() ws.settings["loglevel"] = 40 np.set_printoptions(precision=5) """ Explanation: Fourier Conduction This examples shows how OpenPNM can be used to simulate t...
Ruediger-Braun/compana16
Lektion12-Fehler.ipynb
gpl-3.0
from sympy import * init_printing() import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Lektion 12 End of explanation """ x = Symbol('x', real=True) A = Matrix(3,3, [x,x,0,0,x,x,0,0,x]) A A.exp() """ Explanation: Matrixexponentiale End of explanation """ A = Matrix(4,4,[0,1,0,...
IvarsKarpics/mxcube
bin/mxcube_jupyter_notebook.ipynb
lgpl-3.0
import os import sys cwd = os.getcwd() print cwd mxcube_root = cwd[:-4] print mxcube_root sys.path.insert(0, mxcube_root) from HardwareRepository import HardwareRepository #print "MXCuBE home directory: %s" % cwd hwr_server = mxcube_root + "/HardwareRepository/configuration/xml-qt" HardwareRepository.setHardwareRe...
mattilyra/gensim
docs/notebooks/doc2vec-wikipedia.ipynb
lgpl-2.1
from gensim.corpora.wikicorpus import WikiCorpus from gensim.models.doc2vec import Doc2Vec, TaggedDocument from pprint import pprint import multiprocessing """ Explanation: Doc2Vec to wikipedia articles We conduct the replication to Document Embedding with Paragraph Vectors (http://arxiv.org/abs/1507.07998). In this p...
mne-tools/mne-tools.github.io
0.18/_downloads/66fec418bceb5ce89704fb8b44930330/plot_3d_to_2d.ipynb
bsd-3-clause
# Authors: Christopher Holdgraf <choldgraf@berkeley.edu> # # License: BSD (3-clause) from scipy.io import loadmat import numpy as np from mayavi import mlab from matplotlib import pyplot as plt from os import path as op import mne from mne.viz import ClickableImage # noqa from mne.viz import plot_alignment, snapshot_...
tritemio/multispot_paper
out_notebooks/usALEX-5samples-E-corrected-all-ph-out-7d.ipynb
mit
ph_sel_name = "None" data_id = "7d" # data_id = "7d" """ Explanation: Executed: Mon Mar 27 11:39:17 2017 Duration: 7 seconds. usALEX-5samples - Template This notebook is executed through 8-spots paper analysis. For a direct execution, uncomment the cell below. End of explanation """ from fretbursts import * init...
matthijsvk/multimodalSR
code/Experiments/Tutorials/EbenOlsen_TheanoLasagne/2 - Lasagne Basics/Digit Recognizer.ipynb
mit
# Uncomment and execute this cell for an example solution load spoilers/logreg.py """ Explanation: Exercises 1. Logistic regression The simple network we created is similar to a logistic regression model. Verify that the accuracy is close to that of sklearn.linear_model.LogisticRegression. End of explanation """ # U...
AlbanoCastroSousa/RESSPyLab
examples/Old_RESSPyLab_Parameter_Calibration_Orientation_Notebook.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" import RESSPyLab """ Explanation: Import modules End of explanation """ testFileNames=['example_1.csv'] listCleanT...
dagrha/textual-analysis
textblob_lovecraft.ipynb
mit
from textblob import TextBlob import pandas as pd import pylab as plt import collections import re %matplotlib inline """ Explanation: Sentiment analysis on H.P. Lovecraft's The Shunned House For this, we'll use the TextBlob library (http://textblob.readthedocs.org/en/dev/) and pandas (http://pandas.pydata.org/) End o...
AllenDowney/ThinkStats2
homeworks/homework01.ipynb
gpl-3.0
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(style='white') import utils from utils import decorate from thinkstats2 import Pmf, Cdf """ Explanation: Homework 1 Load and validate GSS data Allen Downey MIT License End of explanation """ def...
stefan-balke/librosa
examples/LibROSA demo.ipynb
isc
from __future__ import print_function # We'll need numpy for some mathematical operations import numpy as np # matplotlib for displaying the output import matplotlib.pyplot as plt import matplotlib.style as ms ms.use('seaborn-muted') %matplotlib inline # and IPython.display for audio output import IPython.display ...
gmonce/datascience
src/Mentiras.ipynb
gpl-3.0
# Datos # Consideramos los votos a setiembre de diferentes años, para ver cómo van cambiando votaciones_factum_2014={'votoFA':0.42,'votoPN':0.32,'votoPC':0.15,'votoPI':0.03,'votoIndefinidos':0.04,'votoOtros':0.02} votaciones_factum_julio_2014={'votoFA':0.42,'votoPN':0.30,'votoPC':0.14,'votoPI':0.03,'votoIndefinidos':0....
google/applied-machine-learning-intensive
content/02_data/05_exploratory_data_analysis/colab-part1.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...
MIT-LCP/mimic-code
mimic-iii/notebooks/aline-aws/aline-awsathena.ipynb
mit
# Install OS dependencies. This only needs to be run once for each new notebook instance. !pip install PyAthena from pyathena import connect from pyathena.util import as_pandas from __future__ import print_function # Import libraries import datetime import numpy as np import pandas as pd import matplotlib.pyplot as ...
y2ee201/Deep-Learning-Nanodegree
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...
OpenWeavers/openanalysis
doc/OpenAnalysis/04 - String Matching.ipynb
gpl-3.0
x = 'this is some random text used for illustrative purposes' x 'this' in x 'not' in x x.index('is') x.index('not') """ Explanation: String Matching Analysis Consider a string of finite length $m$ Let it be $T$. Finding whether a string $P$ of length $n$ exsists in $T$ is known as String Matching, Following is so...
UWashington-Astro300/Astro300-W17
08_Images_In_Python.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import linalg plt.style.use('ggplot') plt.rc('axes', grid=False) # turn off the background grid for images """ Explanation: Multidimentional data - Matrices and Images End of explanation """ my_matrix = np.array([[1,2],[1,1]]) pri...
google/starthinker
colabs/cm360_report_replicate.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: CM360 Report Replicate Replicate a report across multiple networks and advertisers. License Copyright 2020 Google LLC, Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License...
Neuroglycerin/neukrill-net-work
notebooks/model_modifications/Adding MLP Results.ipynb
mit
import pylearn2.utils import pylearn2.config import theano import neukrill_net.dense_dataset import neukrill_net.utils import numpy as np %matplotlib inline import matplotlib.pyplot as plt import holoviews as hl %load_ext holoviews.ipython import sklearn.metrics cd .. settings = neukrill_net.utils.Settings("settings....
tpin3694/tpin3694.github.io
python/data_structure_basics.ipynb
mit
# Create a list of countries, then print the results allies = ['USA','UK','France','New Zealand', 'Australia','Canada','Poland']; allies # Print the length of the list len(allies) # Add an item to the list, then print the results allies.append('China'); allies # Sort list, then print the results allies.sor...
Diyago/Machine-Learning-scripts
DEEP LEARNING/Pytorch from scratch/word2vec-embeddings/Negative_Sampling.ipynb
apache-2.0
# read in the extracted text file with open('data/text8') as f: text = f.read() # print out the first 100 characters print(text[:100]) """ Explanation: Skip-gram Word2Vec In this notebook, I'll lead you through using PyTorch to implement the Word2Vec algorithm using the skip-gram architecture. By implementi...
rjleveque/binder_experiments
clawpack_tests/pyclaw1.ipynb
bsd-2-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from clawpack import pyclaw from clawpack import riemann """ Explanation: A quick introduction to PyClaw PyClaw is a solver for hyperbolic PDEs, based on Clawpack. You can read more about PyClaw in this paper (free version here. In this notebook,...
WomensCodingCircle/CodingCirclePython
Lesson14_NumpyAndMatplotlib/numpy.ipynb
mit
# by convention, we typically import numpy as the alias np import numpy as np """ Explanation: Adapted from Scientific Python: Part 1 (lessons/thw-numpy/numpy.ipynb) Introducing NumPy NumPy is a Python package implementing efficient collections of specific types of data (generally numerical), similar to the standard a...
UserAd/data_science
Twitter bots/Botnet search.ipynb
mit
seeds = ['volya_belousova', 'egor4rgurev', 'kirillfrolovdw', 'ilyazhuchhj'] auth = tweepy.OAuthHandler(OAUTH_KEY, OAUTH_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True) graph = Graph(user=NEO4J_USER, password=NEO4J_SECRET) ...
fweik/espresso
doc/tutorials/visualization/visualization.ipynb
gpl-3.0
from matplotlib import pyplot import espressomd import numpy espressomd.assert_features("LENNARD_JONES") # system parameters (10000 particles) box_l = 10.7437 density = 0.7 # interaction parameters (repulsive Lennard-Jones) lj_eps = 1.0 lj_sig = 1.0 lj_cut = 1.12246 lj_cap = 20 # integration parameters system = esp...
mahieke/maschinelles_lernen
a3/Aufgabe_3.1.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt import math from numpy import linalg as LA import scipy as sp import urllib2 from urllib2 import urlopen, URLError, HTTPError import zipfile import tarfile import sys import os from skimage import data, io, filter from PIL import Image """ Explanat...
rringham/deep-learning-notebooks
udacity/1_notmnist.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. %matplotlib inline from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from scipy import ndimag...
ikegami-yukino/madoka-python
Benchmark.ipynb
bsd-3-clause
import collections import subprocess import itertools import os import time import madoka import numpy as np import redis ALPHANUM = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' NUM_ALPHANUM_COMBINATION = 238328 zipf_array = np.random.zipf(1.5, NUM_ALPHANUM_COMBINATION) def python_memory_usage()...
stevetjoa/stanford-mir
why_mir.ipynb
mit
ipd.display( ipd.YouTubeVideo("grL4JMs0hDc", start=75) ) """ Explanation: &larr; Back to Index What is Music Information Retrieval? While you listen to these excerpts, name as many of its musical characteristics as you can. Can you name the genre? tempo? instruments? mood? time signature? key signature? chord progress...
sympy/scipy-2017-codegen-tutorial
notebooks/cython-examples.ipynb
bsd-3-clause
import numpy as np x = np.random.randn(10000) """ Explanation: Writing Cython In this notebook, we'll take a look at how to implement a simple function using Cython. The operation we'll implement is the first-order diff, which takes in an array of length $n$: $$\mathbf{x} = \begin{bmatrix} x_1 \ x_2 \ \vdots \ x_n\end...
CNS-OIST/STEPS_Example
user_manual/source/API_2/Interface_Tutorial_4_Complexes.ipynb
gpl-2.0
import steps.interface from steps.model import * mdl = Model() with mdl: A0, A1, A2 = SubUnitState.Create() ASU = SubUnit.Create([A0, A1, A2]) CA = Complex.Create([ASU, ASU, ASU, ASU], statesAsSpecies=True) """ Explanation: Multi-state complexes <div class="admonition note"> **Topics**: Comple...
Kaggle/learntools
notebooks/data_cleaning/raw/tut1.ipynb
apache-2.0
# modules we'll use import pandas as pd import numpy as np # read in all our data nfl_data = pd.read_csv("../input/nflplaybyplay2009to2016/NFL Play by Play 2009-2017 (v4).csv") # set seed for reproducibility np.random.seed(0) """ Explanation: Welcome to the Data Cleaning course on Kaggle Learn! Data cleaning is a k...
folivetti/PIPYTHON
Aula08Recursividade.ipynb
mit
def imprime(i): print (i) def imprimeLista(l): for e in l: imprime (e) imprimeLista([1, 3, 5, 7]) """ Explanation: Introdução à Programação em Python Recursão Em um programa é muito comum chamarmos uma função dentro de uma outra função. End of explanation """ def fatorial(n): fat = 1 while...
moble/spherical_functions
Notes/conventions.ipynb
mit
import csv import sympy from sympy import sin, cos from sympy.parsing.mathematica import mathematica from sympy.physics.quantum.spin import Rotation from sympy.abc import _clash import numpy as np import quaternion import spherical_functions as sf """ Explanation: NOTE: I've run this notebook with the correction to s...
conferency/find-my-reviewers
tutorials/Preprocessing_and_Training_LDA.ipynb
mit
# Loading metadata from trainning database con = sqlite3.connect("F:/FMR/data.sqlite") db_documents = pd.read_sql_query("SELECT * from documents", con) db_authors = pd.read_sql_query("SELECT * from authors", con) data = db_documents # just a handy alias data.head() """ Explanation: Preparing Data In this step, we are ...
phoebe-project/phoebe2-docs
development/tutorials/dpdt.ipynb
gpl-3.0
#!pip install "phoebe>=2.4,<2.5" """ Explanation: Period Change (dpdt) 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 import numpy as np impo...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/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', 'inpe', 'sandbox-3', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-3 Topic: Ocean Sub-Topics: Timestepping Framework, Advection...
GoogleCloudPlatform/ai-platform-samples
notebooks/templates/ai_platform_notebooks_template_hybrid.ipynb
apache-2.0
%pip install -U missing_or_updating_package --user """ Explanation: <table align="left"> <td> <a href="https://colab.research.google.com/github/GoogleCloudPlatform/ai-platform-samples/blob/main/notebooks/templates/ai_platform_notebooks_template_hybrid.ipynb""> <img src="https://cloud.google.com/ml-engine/i...