repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
feststelltaste/software-analytics
demos/20190425_JUGH_Kassel/DataScienceMeetsSoftwareData.ipynb
gpl-3.0
import pandas as pd log = pd.read_csv("../dataset/linux_blame_log.csv.gz") log.head() """ Explanation: Mit Datenanalysen Probleme in der Entwicklung aufzeigen <small>Java User Group Hessen, Kassel, 25.04.2019</small> <b>Markus Harrer</b>, Software Development Analyst Twitter: @feststelltaste Blog: feststelltaste.de <...
mne-tools/mne-tools.github.io
0.19/_downloads/8f7e6dfc30a66795f2d4e4ae5ca6d23e/plot_40_artifact_correction_ica.ipynb
bsd-3-clause
import os import mne from mne.preprocessing import (ICA, create_eog_epochs, create_ecg_epochs, corrmap) sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif...
hetaodie/hetaodie.github.io
assets/media/uda-ml/supervisedlearning/jc/为慈善机构寻找捐助者/charity_finish/charity/boston_housing/boston_housing.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd from sklearn.model_selection import ShuffleSplit # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the Boston housing dataset data = pd.read_csv('hous...
johnnyliu27/openmc
examples/jupyter/expansion-filters.ipynb
mit
%matplotlib inline import openmc import numpy as np import matplotlib.pyplot as plt """ Explanation: OpenMC's general tally system accommodates a wide range of tally filters. While most filters are meant to identify regions of phase space that contribute to a tally, there are a special set of functional expansion filt...
ueapy/enveast_python_course_materials
Day_3/19-Cartopy-Intro.ipynb
mit
import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Brief look at Cartopy Cartopy is a Python package that provides easy creation of maps with matplotlib. Cartopy vs Basemap Cartopy is better integrated with matplotlib and in a more active development state Proper handling of datelines in cartopy - on...
mjabri/holoviews
doc/Tutorials/Pandas_Seaborn.ipynb
bsd-3-clause
import itertools import numpy as np import pandas as pd import seaborn as sb import holoviews as hv np.random.seed(9221999) """ Explanation: In this notebook we'll look at interfacing between the composability and ability to generate complex visualizations that HoloViews provides, the power of pandas library datafra...
lenovor/lightfm
examples/movielens/learning_schedules.ipynb
apache-2.0
import numpy as np import data %matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt from lightfm import LightFM train, test = data.get_movielens_data() train.data = np.ones_like(train.data) test.data = np.ones_like(test.data) from sklearn.metrics import roc_auc_score def preci...
t-vi/candlegp
notebooks/minibatches.ipynb
apache-2.0
import sys, os import numpy import time sys.path.append(os.path.join(os.getcwd(),'..')) import candlegp from matplotlib import pyplot import torch from torch.autograd import Variable %matplotlib inline pyplot.style.use('ggplot') import IPython M = 50 def func(x): return torch.sin(x * 3*3.14) + 0.3*torch.cos(x * ...
mne-tools/mne-tools.github.io
stable/_downloads/fb92190904499e5a95e92ab70177abf7/60_make_fixed_length_epochs.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt import mne from mne.preprocessing import compute_proj_ecg from mne_connectivity import envelope_correlation sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', ...
podondra/bt-spectraldl
notebooks/03-labeled-data.ipynb
gpl-3.0
%matplotlib inline import numpy as np import collections import math import matplotlib.pyplot as plt import h5py import csv LABELS_FILE = 'data/ondrejov-dataset.csv' with open(LABELS_FILE, newline='') as f: labels = list(csv.DictReader(f)) """ Explanation: Labels Addition and Statistics This notebook adds label...
strint/tensorflow
tensorflow/examples/tutorials/deepdream/deepdream.ipynb
apache-2.0
# boilerplate code from __future__ import print_function import os from io import BytesIO import numpy as np from functools import partial import PIL.Image from IPython.display import clear_output, Image, display, HTML import tensorflow as tf """ Explanation: DeepDreaming with TensorFlow Loading and displaying the m...
w4zir/ml17s
lectures/.ipynb_checkpoints/lec03-gradient-descent-checkpoint.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from sklearn import linear_model import matplotlib.pyplot as plt # read data in pandas frame dataframe = pd.read_csv('datasets/house_dataset1.csv') # assign x and y X = np.array(dataframe[['Size']]) y = np.array(dataframe[['Price']]) m = y.size # number of tr...
ilogue/pyrsa
demos/Temporal RSA.ipynb
lgpl-3.0
import numpy as np import matplotlib.pyplot as plt import pyrsa import pickle from pyrsa.rdm import calc_rdm_movie """ Explanation: Temporal RSA This demo notebook demonstrates how to work with temporal data in the RSA toolbox So far, it demonstrates how to (1) import temporal dataset into the pyrsa.data.TemporalData...
eds-uga/csci1360-fa16
assignments/A3/A3_Q2.ipynb
mit
import numpy as np np.random.seed(85473) list1 = np.random.randint(100, size = 10).tolist() list2 = np.random.randint(100, size = 10).tolist() list3 = np.random.randint(100, size = 10).tolist() ### BEGIN SOLUTION ### END SOLUTION """ Explanation: Q2 More loops, this time with generators. A Print out the correspondi...
miykael/nipype_tutorial
notebooks/example_normalize.ipynb
bsd-3-clause
%%bash datalad get -J 4 -d /data/ds000114 /data/ds000114/derivatives/fmriprep/sub-0[2345789]/anat/*h5 """ Explanation: Example 3: Normalize data to MNI template This example covers the normalization of data. Some people prefer to normalize the data during the preprocessing, just before smoothing. I prefer to do the 1s...
MingChen0919/learning-apache-spark
notebooks/02-data-manipulation/2.9-user-defined-sql-function (udf).ipynb
mit
from pyspark.sql.types import * from pyspark.sql.functions import udf mtcars = spark.read.csv('../../data/mtcars.csv', inferSchema=True, header=True) mtcars = mtcars.withColumnRenamed('_c0', 'model') mtcars.show(5) """ Explanation: udf() function and sql types The pyspark.sql.functions.udf() function is a very import...
chris1610/pbpython
notebooks/Bullet-Graph-Article.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import seaborn as sns from matplotlib.ticker import FuncFormatter %matplotlib inline """ Explanation: Notebook for Building a bullet chart in python. Full article posted in http://pbpython.com/bullet-graph.html End of explanation """ sns.palplot(sns.light_palette("green", 5)) sns.pa...
mercybenzaquen/foundations-homework
foundations_hw/08/Homework8_benzaquen_mass_shooting_data.ipynb
mit
!pip install pandas !pip install matplotlib import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Mass shootings in America in 2015 Data from http://www.shootingtracker.com/Main_Page Important! Their definition of mass shooting is: FOUR or more shot and/or killed in a single event [...
jdsanch1/SimRC
02. Parte 2/15. Clase 15/.ipynb_checkpoints/02Class NB-checkpoint.ipynb
mit
#importar los paquetes que se van a usar import pandas as pd import pandas_datareader.data as web import numpy as np import datetime from datetime import datetime import scipy.stats as stats import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline #algunas opciones para Python pd.set_option('display.not...
stevosn/ray_tracing
ray_tracing.ipynb
mit
# setup path to ray_tracing package import sys sys.path.append('~/Documents/python/ray_tracing/') import ray_tracing as rt from matplotlib import rcParams rcParams['figure.figsize'] = [8, 4] import matplotlib.pyplot as plt plt.ion() """ Explanation: Simple ray tracing End of explanation """ osys = rt.OpticalSystem...
ktaneishi/deepchem
contrib/dragonn/GTC_workshop_tutorial.ipynb
mit
%reload_ext autoreload %autoreload 2 #from tutorial_utils import * %matplotlib inline """ Explanation: How to train your DragoNN tutorial Tutorial length: 25-30 minutes with a CPU. Outline * How to use this tutorial * Review of patterns in transcription factor binding sites * Learning to localize homotypic motif densi...
tensorflow/docs-l10n
site/ja/probability/examples/Linear_Mixed_Effects_Models.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
nnadeau/pybotics
examples/trajectory_generation.ipynb
mit
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def plot_poses(p): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.plot(xs=p[:, 0, -1], ys=p[:, 1, -1], zs=p[:, 2, -1], marker='o') ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') ax.set_xli...
fzotter/Ambisonic-Jupyter-Notebook
05-rErVofAmbisonicPanningFunctionsCircle.ipynb
mit
import numpy as np import scipy as sp import math from bokeh.plotting import figure, output_file, show from bokeh.io import output_notebook def inphase_weights(N): a=np.ones(N+1) for n in range(1,N+1): a[n]=(N-n+1)/(1.0*(N+n))*a[n-1] return a def maxre_weights(N): m=np.arange(0,N+1) a=np....
phoebe-project/phoebe2-docs
2.0/tutorials/atm_passbands.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" """ Explanation: Atmospheres & Passbands Setup Let's first make sure we have the latest version of PHOEBE 2.0 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 """ %matplotlib inli...
kwant-project/kwant-tutorial-2016
3.4.graphene_qshe-cheat.ipynb
bsd-2-clause
# We'll have 3D plotting and 2D band structure, so we need a handful of helper functions. %run matplotlib_setup.ipy from types import SimpleNamespace from ipywidgets import interact import matplotlib from matplotlib import pyplot from mpl_toolkits import mplot3d import numpy as np import kwant from wraparound impor...
probml/pyprobml
notebooks/misc/linreg_hierarchical_numpyro.ipynb
mit
%matplotlib inline !pip install -q numpyro@git+https://github.com/pyro-ppl/numpyro arviz !pip install arviz !pip install seaborn import matplotlib.pyplot as plt import numpy as np import pandas as pd import arviz as az import seaborn as sns import numpyro from numpyro.infer import MCMC, NUTS, Predictive import numpyro...
IS-ENES-Data/submission_forms
test/Templates/CMIP6_submission_form.ipynb
apache-2.0
from dkrz_forms import form_widgets form_widgets.show_status('form-submission') """ Explanation: DKRZ CMIP6 submission form for ESGF data publication General Information (to be completed based on official CMIP6 references) Data to be submitted for ESGF data publication must follow the rules outlined in the CMIP6 Arch...
NeuroDataDesign/seelviz
Jupyter/Ilastik and Membrane Detection.ipynb
apache-2.0
## Titled getspacing.py from ndreg import * import matplotlib import ndio.remote.neurodata as neurodata import nibabel as nb inToken = 'Fear197' inImg = imgDownload(inToken, resolution=5) print(inImg.GetSpacing()) """ Explanation: October 19, 2016 Ilastik Membrane Detection Decision Tree and Random Forest Decision tr...
google/starthinker
colabs/smartsheet_report_to_bigquery.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: SmartSheet Report To BigQuery Move report data into a BigQuery table. 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. You may obta...
rodrigomas/boston_housing
boston_housing.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd #from sklearn.cross_validation import ShuffleSplit # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the Boston housing dataset data = pd.read_csv('ho...
Lstyle1/Deep_learning_projects
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
aleph314/K2
Foundations/Data Collection and Analysis/Pandas-Exercise.ipynb
gpl-3.0
import numpy as np import pandas as pd """ Explanation: Pandas Exercise When working on real world data tasks, you'll quickly realize that a large portion of your time is spent manipulating raw data into a form that you can actually work with, a process often called data munging or data wrangling. Different programmi...
riga/order
examples/intro.ipynb
bsd-3-clause
import order as od import scinum as sn """ Explanation: order: An introduction In this example we get to know the most important classes of order and how they are related to describe your analysis and all external data. We will set up a simple but scalable example analysis that involves most of the API. For more info,...
feststelltaste/software-analytics
notebooks/demo_pandas_jqassistant.ipynb
gpl-3.0
import py2neo import pandas as pd """ Explanation: A simple example on how to use jQAssistant with Python Pandas I'm a huge fan of the software analysis framework jQAssistant (http://www.jqassistant.org). It's a great tool for scanning and validating various software artifacts (get a glimpse at https://buschmais.githu...
lcdutramartins/UdacityML
titanic_survival_exploration/titanic_survival_exploration.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd from IPython.display import display # Allows the use of display() for DataFrames # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the dataset in_file...
patrickfuller/igraph
examples/ipython.ipynb
mit
import jgraph jgraph.draw([(1, 2), (2, 3), (3, 4), (4, 1), (4, 5), (5, 2)]) """ Explanation: jgraph in the IPython notebook I wrote jgraph to visualize graphs in 3D purely out of curiosity. I couldn't find any 3D force-directed graph libraries when I wrote it, so this happened. It can be used with the notebook to inte...
MichaelGrupp/evo
notebooks/metrics.py_API_Documentation.ipynb
gpl-3.0
from evo.core import metrics """ Explanation: metrics.py API & Algorithm Documentation This notebook documents the API and the theory behind the core metrics. Setup End of explanation """ from evo.tools import log log.configure_logging(verbose=True, debug=True, silent=False) import pprint import numpy as np from e...
mortada/notebooks
blog/fredapi_examples.ipynb
apache-2.0
from fredapi import Fred fred = Fred() """ Explanation: Import the fredapi module. Note that I have set my api key to the environment variable FRED_API_KEY. You can also pass your key explicitly. End of explanation """ import pandas as pd pd.options.display.max_colwidth = 60 %matplotlib inline import matplotlib.pyp...
suresh/notebooks
Chapter 1 - Python DS Handbook.ipynb
mit
L = list(range(10)) L type(L) type(L[0]) L2 = [str(c) for c in L] type(L2[0]) all(type(e) == int for e in L) """ Explanation: Python list is more than a list End of explanation """ L3 = [True, '2', 3.0, 4] [type(item) for item in L3] tuple(L3) """ Explanation: List can be heterogeneous list End of explanation...
lcharleux/numerical_analysis
doc/Interpolation/2D_Interpolation.ipynb
gpl-2.0
# Setup %matplotlib inline import numpy as np import matplotlib.pyplot as plt import matplotlib params = {'font.size' : 14, 'figure.figsize':(15.0, 8.0), 'lines.linewidth': 2., 'lines.markersize': 15,} matplotlib.rcParams.update(params) """ Explanation: 2D Interpolation (and above) S...
d-k-b/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...
DoWhatILove/turtle
programming/python/notebooks/.ipynb_checkpoints/plot_segmentation_toy-checkpoint.ipynb
mit
print(__doc__) # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.feature_extraction import image from sklearn.cluster import spectral_clustering l = ...
xiaoxiaoyao/MyApp
jupyter_notebook/getKeyWord.ipynb
unlicense
# -*- coding=utf-8 -*- import jieba.analyse import jieba with open('../docs/HLS.TXT', encoding='utf-8') as f: data = f.read() """ Explanation: 如何用Python提取中文关键词? 本文一步步为你演示,如何用Python从中文文本中提取关键词。如果你需要对长文“观其大略”,不妨尝试一下。(单一文本关键词的提取方法) End of explanation """ for keyword, weight in jieba.analyse.extract_tags(data, topK=...
yy/dviz-course
m04-perception/lab.ipynb
mit
import pandas as pd import math import matplotlib.pyplot as plt %matplotlib inline """ Explanation: W3 Lab: Perception In this lab, we will learn basic usage of pandas library and then perform a small experiment to test the perception of length and area. End of explanation """ from vega_datasets import data data.li...
Serulab/Py4Bio
notebooks/Chapter 15 - Sequence Manipulation in Batch.ipynb
mit
!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 Note: Before opening the fil...
GoogleCloudPlatform/ai-platform-samples
notebooks/samples/explanations/tf2/ai-explanations-image.ipynb
apache-2.0
PROJECT_ID = "[your-project-id]" #@param {type:"string"} if PROJECT_ID == "" or PROJECT_ID is None or PROJECT_ID == "[your-project-id]": # Get your GCP project id from gcloud shell_output = !gcloud config list --format 'value(core.project)' 2>/dev/null PROJECT_ID = shell_output[0] print("Project ID:", ...
trangel/Insight-Data-Science
analysis-data/.ipynb_checkpoints/Insight medical posts-checkpoint.ipynb
gpl-3.0
# Set up paths/ os import os import sys this_path=os.getcwd() os.chdir("../data") sys.path.insert(0, this_path) # Load datasets import pandas as pd df = pd.read_csv("MedHelp-posts.csv",index_col=0) df.head(2) df_users = pd.read_csv("MedHelp-users.csv",index_col=0) df_users.head(2) # 1 classify users as professi...
LaubachLab/Spikes-and-Fields
Interacting with R.ipynb
gpl-3.0
import numpy as np, pandas as pd, feather from scipy.io import loadmat, savemat """ Explanation: My data analysis workflow depends on R. I tend to use old Matlab code, run in Octave or via oct2py, or new Python code for data data wrangling. I have moved to matplotlib and seaborn for all graphics. I still depend on R f...
4dsolutions/Python5
OverviewNotes_PYTDS.ipynb
mit
import numpy as np import pandas as pd squares = np.array(list(64 * " "), dtype = np.str).reshape(8,8) squares print('♔♕♖') squares[0][0] = '♖' squares[7][0] = '♖' squares[0][7] = '♖' squares[7][7] = '♖' squares chessboard = pd.DataFrame(squares, index=range(1,9), columns = ['wR','wKn',...
uber/pyro
tutorial/source/intro_part_i.ipynb
apache-2.0
import torch import pyro pyro.set_rng_seed(101) """ Explanation: An Introduction to Models in Pyro The basic unit of probabilistic programs is the stochastic function. This is an arbitrary Python callable that combines two ingredients: deterministic Python code; and primitive stochastic functions that call a random...
pauliacomi/pyGAPS
docs/examples/modelling.ipynb
mit
# import isotherms %run import.ipynb # Then the modelling module import pygaps.modelling as pgm """ Explanation: Isotherm model fitting In this notebook we'll attempt to fit isotherms using the included models. First, make sure the data is imported by running the import notebook. End of explanation """ isotherm = n...
TheMitchWorksPro/DataTech_Playground
PY_Basics/TMWP_PY_CrazyList_Indexing_and_Related_Experiments.ipynb
mit
stupidList = [[1,2,3],[4,5,6]] print(stupidList) stupidList[0][1] """ Explanation: <div align="right">Python 2.7</div> Indexing and Related Experiments in Python 2.7 Though this content is in Python 2.7, most if not all of it should work the same in Python 3.x. TOC Indexing Experiments - Explores different complex s...
dcavar/python-tutorial-for-ipython
notebooks/Parsing Natural Language in Python.ipynb
apache-2.0
import sys """ Explanation: Parsing Natural Language in Python (C) 2018 by Damir Cavar License: Creative Commons Attribution-ShareAlike 4.0 International License (CA BY-SA 4.0) This is a tutorial related to the discussion of parsing with Probabilistic Context Free Grammars (PCFG) in the class Advanced Natural Language...
googleinterns/bizview-semi-supervised-learning
Mixmatch/streetview_dataset/parse_data_to_tfrecord_main.ipynb
apache-2.0
from parse_data_to_tfrecord_lib import read_tfrecord, write_tfrecord_from_images, filter_image_with_confidence_threshold, batch_read_write_tfrecords import numpy as np import tensorflow as tf import os # used for directory operations from shutil import copyfile tf.enable_eager_execution() # Global constants INPUT_RE...
IBMDecisionOptimization/docplex-examples
examples/mp/jupyter/logical_cts.ipynb
apache-2.0
import sys try: import docplex.mp except: raise Exception('Please install docplex. See https://pypi.org/project/docplex/') """ Explanation: Use logical constraints with decision optimization This tutorial includes everything you need to set up decision optimization engines, build a mathematical programming mod...
bobflagg/deepER
deeper/part1-NER.ipynb
apache-2.0
import sys, os from numpy import * from matplotlib.pyplot import * %matplotlib inline matplotlib.rcParams['savefig.dpi'] = 100 %load_ext autoreload %autoreload 2 """ Explanation: CS 224D Assignment #2 Part [1]: Deep Networks: NER Window Model For this first part of the assignment, you'll build your first "deep" netwo...
blua/deep-learning
tv-script-generation/olds_ipnbs/old_dlnd_tv_script_generation.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 scrip...
ga7g08/ga7g08.github.io
_notebooks/2015-07-06-More-Parallelising-emcee-using-IPython-parallel.ipynb
mit
%matplotlib inline from __future__ import print_function import emcee import triangle import numpy as np import scipy.optimize as op import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator # Reproducible results! np.random.seed(123) # Choose the "true" parameters. m_true = -0.9594 b_true = 4.294 ...
SRI-CSL/libpoly
examples/cad/SMT 2017 (CAD).ipynb
lgpl-3.0
# Get all the reductums (including the polynomial itself), but not the constants def get_reductums(f, x): R = [] while f.var() == x: R.append(f); f = f.reductum() return R """ Explanation: Get the reductums of a polynomial: - f is a polynomial - x the top variable End of explanation """ # Add polynomials to pr...
foxan/dataquest
Data Analysis with Pandas - Intermediate/Challenge - Summarizing Data.ipynb
apache-2.0
# %sh # # download source file # wget https://raw.githubusercontent.com/fivethirtyeight/data/master/college-majors/all-ages.csv # wget https://raw.githubusercontent.com/fivethirtyeight/data/master/college-majors/recent-grads.csv # ls -l import pandas as pd all_ages = pd.read_csv("all-ages.csv") print all_ages.columns...
arank/mxnet
example/recommenders/demo1-MF2-fancy.ipynb
apache-2.0
import mxnet as mx from movielens_data import get_data_iter, max_id from matrix_fact import train # If MXNet is not compiled with GPU support (e.g. on OSX), set to [mx.cpu(0)] # Can be changed to [mx.gpu(0), mx.gpu(1), ..., mx.gpu(N-1)] if there are N GPUs ctx = [mx.gpu(0)] train_test_data = get_data_iter(batch_size=...
zhmcclient/python-zhmcclient
docs/notebooks/02_connections.ipynb
apache-2.0
import zhmcclient """ Explanation: Tutorial 2: Connecting to an HMC In order to use the zhmcclient package in a Jupyter notebook, it must be installed in the Python environment that was used to start Jupyter. Trying to import it shows whether it is installed: End of explanation """ zhmc = '9.152.150.65' session = z...
mne-tools/mne-tools.github.io
0.21/_downloads/7bbeb6a728b7d16c6e61cd487ba9e517/plot_morph_volume_stc.ipynb
bsd-3-clause
# Author: Tommy Clausner <tommy.clausner@gmail.com> # # License: BSD (3-clause) import os import nibabel as nib import mne from mne.datasets import sample, fetch_fsaverage from mne.minimum_norm import apply_inverse, read_inverse_operator from nilearn.plotting import plot_glass_brain print(__doc__) """ Explanation: M...
xmnlab/notebooks
udacity/deep-learn/1_notmnist.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from IPython.display import display, Image from scipy import ndimage from sklearn.linear_model import LogisticRegression from six.moves.urllib.request import urlretrieve from six.moves import cPickle as pickle ...
wesleybeckner/salty
scripts/vae/wes_vae_one.ipynb
mit
properties = ['density', 'cpt', 'viscosity', 'thermal_conductivity', 'melting_point'] for i in range(len(properties)): props = properties[:i+1] devmodel = salty.aggregate_data(props, merge='Union') devmodel.Data['smiles_string'] = devmodel.Data['smiles-cation'] + "." + devmodel.Data['smiles-an...
jorgemauricio/INIFAP_Course
ejercicios/Pandas/5_Merge, Join, and Concat.ipynb
mit
# Librerias import pandas as pd df1 = pd.DataFrame({'A': ['A0', 'A1', 'A2', 'A3'], 'B': ['B0', 'B1', 'B2', 'B3'], 'C': ['C0', 'C1', 'C2', 'C3'], 'D': ['D0', 'D1', 'D2', 'D3']}, index=[0, 1, 2, 3]) df2 = pd.DataFrame({'A': ...
scientific-visualization-2016/ClassMaterials
Week-03/03-netcdf.ipynb
cc0-1.0
from netCDF4 import Dataset import numpy as np import numpy.ma as ma filename = "tos_O1_2001-2002.nc" ds = Dataset(filename, mode="r") """ Explanation: A Short Introduction to netCDF What is netCDF? "NetCDF is an abstraction that supports a view of data as a collection of self-describing, portable objects that can b...
ual/hedonic-models
08_linear_regression.ipynb
bsd-3-clause
# imports import pandas as pd import matplotlib.pyplot as plt # this allows plots to appear directly in the notebook %matplotlib inline """ Explanation: Introduction to Linear Regression Adapted from Chapter 3 of An Introduction to Statistical Learning ||continuous|categorical| |---|---|---| |supervised|regression|cl...
5agado/data-science-learning
deep learning/GAN/DCGAN.ipynb
apache-2.0
import sys import yaml import tensorflow as tf import numpy as np import pandas as pd import functools from pathlib import Path from datetime import datetime from tqdm import tqdm_notebook as tqdm # Plotting import matplotlib import matplotlib.pyplot as plt from matplotlib import animation plt.rcParams['animation.ffmp...
tomekkorbak/lstm-for-aspect-based-sentiment-analysis
presentation/Presentation.ipynb
gpl-3.0
import json from itertools import chain from pprint import pprint from time import time import os import numpy as np %matplotlib inline import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from gensim.models import Word2Vec from gensim.corpora.dictionary import Dictionary os.environ['THEANO_...
jorgemauricio/INIFAP_Course
ejercicios/Machine_Learning/MachineLearning.ipynb
mit
# librerias import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression # leer el csv data = pd.read_csv('../../data/db_join_wrf_tpro_10_25_tmid_10_20.csv') # estructura del dataFrame data.head() # columnas del dataframe data.columns # información del dataFrame data.info() # utilizar s...
sarvex/PythonMachineLearning
Chapter 2/Linear models.ipynb
isc
from sklearn.datasets import make_regression from sklearn.cross_validation import train_test_split X, y, true_coefficient = make_regression(n_samples=80, n_features=30, n_informative=10, noise=100, coef=True, random_state=5) X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=5) print(X_train.shape)...
whitead/numerical_stats
unit_6/hw_2017/problem_set_2.ipynb
gpl-3.0
#The points awarded this cell corresopnd to partial credit and/or documentation ### BEGIN SOLUTION def power(x, p=2): '''Computes x^p Args: x: input number p: input power, defaults to 2 returns: x^p as a floating point ''' return x**p ### END SOLUTION '''Check if your...
biothings/biothings_explorer
jupyter notebooks/COVID_demo.ipynb
apache-2.0
!pip install git+https://github.com/biothings/biothings_explorer#egg=biothings_explorer """ Explanation: Introduction This notebook demonstrates basic usage of BioThings Explorer, an engine for autonomously querying a distributed knowledge graph. BioThings Explorer can answer two classes of queries -- "EXPLAIN" and "P...
elastic/examples
Machine Learning/Class Assigment Objectives/classification-class-assignment-objective.ipynb
apache-2.0
# Some general notebook setting host = 'http://localhost:9200' # IMPORTANT: create a file credentials.json with credentials for your Elasticsearch instance! with open('credentials.json') as f: data = json.load(f) username = data['username'] password = data['password'] es = Elasticsearch(host, http_auth=(u...
sangheestyle/ml2015project
howto/model08_refactoring_functions.ipynb
mit
import gzip import pickle from os import path from collections import defaultdict from numpy import sign """ Load buzz data as a dictionary. You can give parameter for data so that you will get what you need only. """ def load_buzz(root='../data', data=['train', 'test', 'questions'], format='pklz'): buzz_data = {...
astroNN/astroNN
notebooks/1_notmnist.ipynb
mit
# Third-party packages import h5py import matplotlib.pyplot as pl %matplotlib inline import numpy as np from sklearn.linear_model import LogisticRegression # this package from astronn.data import fetch_notMNIST """ Explanation: Deep Learning Assignment 1 The objective of this assignment is to learn about simple data ...
RagsX137/TF_Tutorial
My+own+KNN+Classifier.ipynb
apache-2.0
from sklearn import datasets iris = datasets.load_iris() X = iris.data # Iris.data contains the features or independent variables. y = iris.target # Iris.target contains the labels or the dependent variables. """ Explanation: Tutorial : Creating a Simple Nearest Neighbor Classifier from scratch This is based on the K...
jgacostag/Taller
TallerETVL_Módulo1 - JgAG.ipynb
mit
import pandas as pd x=pd.DataFrame() #Mejor hasta ahora for m in range(1995,2018): if m < 2016: o='.xlsx' else: o='.xls' if m < 2000: sK=3 else: sK=2 n='Precio_Bolsa_Nacional_($kwh)_' + str(m) + o y=pd.read_excel(n, skiprows=sK, parse_cols=24) x= x.app...
feststelltaste/software-analytics
demos/20180731_Munich/Wertloser Code.ipynb
gpl-3.0
import pandas as pd coverage = pd.read_csv("../dataset/jacoco_production_coverage_spring_petclinic.csv") coverage.head() """ Explanation: Demo Strategic Redesign für das Projekt „Spring Petclinic“ Auslastungsdaten vom Produktivbetrieb Datenquelle: Gemessen wurde der Anwendungsbetrieb der Software über einen Zeitraum ...
darkomen/TFG
medidas/13082015/.ipynb_checkpoints/Análisis de datos Ensayo 1-checkpoint.ipynb
cc0-1.0
#Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Abrimos el fichero csv con los datos...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/hadgem3-gc31-hh/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'hadgem3-gc31-hh', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: NERC Source ID: HADGEM3-GC31-HH Topic: Atmos Sub-Topics: Dynamical Core, Radia...
UCBerkeleySETI/breakthrough
PKS/voyager.ipynb
gpl-3.0
%matplotlib inline import blimpy as bl import pylab as plt import numpy as np plt.rcParams['font.size'] = 12 """ Explanation: Voyager 2 Example data taken on 2018-10-22 during MARS receiver testing, using the Breakthrough Listen backend. Data recorded over full bandwidth of MARS receiver, here we have extracted a sm...
raschuetz/foundations-homework
05/NYT-API.ipynb
mit
import requests """ 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 include your API key in all re...
Erhil/PythonNpCourse
materials/week 1/IPython_intro.ipynb
mit
print(math.sqrt(4)) import math """ Explanation: Jupyter Notebook -- это удобно! Код организван отдельными болками. Блоки кода можно выполнять в произвольном порядке. Сочетает в себе достоинства полноценных скриптов и интерактивной оболочки. Порядок выполнения блоков указан слева от ячейки. End of explanation """ i...
Bismarrck/deep-learning
gan_mnist/Intro_to_GANs_Exercises.ipynb
mit
%matplotlib inline import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
dacoex/pvlib-python
docs/tutorials/solarposition.ipynb
bsd-3-clause
import datetime # scientific python add-ons import numpy as np import pandas as pd # plotting stuff # first line makes the plots appear in the notebook %matplotlib inline import matplotlib.pyplot as plt # seaborn makes your plots look better try: import seaborn as sns sns.set(rc={"figure.figsize": (12, 6)}) ...
brockk/clintrials
tutorials/matchpoint/DTPs.ipynb
gpl-3.0
import numpy as np from scipy.stats import norm from clintrials.dosefinding.efftox import EffTox, LpNormCurve, efftox_dtp_detail from clintrials.dosefinding.efficacytoxicity import dose_transition_pathways, print_dtps real_doses = [7.5, 15, 30, 45] trial_size = 30 cohort_size = 3 first_dose = 3 prior_tox_probs = (0.0...
dsacademybr/PythonFundamentos
Cap04/Notebooks/DSA-Python-Cap04-04-Datetime.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 4</font> Download: http://github.com/dsacademybr End of explanation """ import ...
INM-6/Python-Module-of-the-Week
session08-pandas/Pandas PYMOTW.ipynb
mit
import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: PANDAS ARE AWESOME <img src="https://i.imgur.com/vxKOi.gif" width="1200" height="1200"> <a href="https://s3.amazonaws.com/assets.datacamp.com/blog_assets/PandasPythonForDataScience.pdf">Down...
sdonapar/data_analysis_python
pandas_overview.ipynb
mit
person_height_ft = pd.Series([5.5,5.2,5.8,6.1,4.8],name='height', index = ['person_a','person_b','person_c','person_d','person_e'],dtype=np.float64) person_height_ft person_height_ft.values person_height_ft.index """ Explanation: Pandas has two important data strucures Series and DataFrame Series Se...
esa-as/2016-ml-contest
MandMs/Facies_classification-M&Ms_plurality_voting_classifier.ipynb
apache-2.0
%matplotlib inline import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as colors from mpl_toolkits.axes_grid1 import make_axes_locatable import pandas as pd from pandas import set_option set_option("display.max_rows", 10) pd.options.mode.chained_assignment = None from ...
aje/POT
docs/source/auto_examples/plot_OT_L1_vs_L2.ipynb
mit
# Author: Remi Flamary <remi.flamary@unice.fr> # # License: MIT License import numpy as np import matplotlib.pylab as pl import ot import ot.plot """ Explanation: 2D Optimal transport for different metrics 2D OT on empirical distributio with different gound metric. Stole the figure idea from Fig. 1 and 2 in https://...
GeosoftInc/gxpy
examples/jupyter_notebooks/Tutorials/Tilt-Depth.ipynb
bsd-2-clause
import geosoft.gxpy.gx as gx import geosoft.gxpy.utility as gxu import geosoft.gxpy.grid as gxgrd import geosoft.gxpy.grid_utility as gxgrdu import geosoft.gxpy.map as gxmap import geosoft.gxpy.view as gxview import geosoft.gxpy.group as gxgrp import numpy as np from IPython.display import Image gxc = gx.GXpy() gxu.c...
empirical-org/WikipediaSentences
notebooks/BERT-4 Experiments Multilabel.ipynb
agpl-3.0
from multilabel import EATINGMEAT_BECAUSE_MAP, EATINGMEAT_BUT_MAP, JUNKFOOD_BECAUSE_MAP, JUNKFOOD_BUT_MAP label_map = EATINGMEAT_BECAUSE_MAP import torch from pytorch_transformers.tokenization_bert import BertTokenizer from pytorch_transformers.modeling_bert import BertForSequenceClassification BERT_MODEL = 'bert-l...
google/iree
samples/dynamic_shapes/dynamic_shapes.ipynb
apache-2.0
#@title Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """ Explanation: Copyright 2021 The IREE Authors End of explanation """ #@title General setup import os import tempfile ARTIFACT...
thewtex/ieee-nss-mic-scipy-2014
2_IPython.ipynb
apache-2.0
print("Hello world!") """ Explanation: IPython Notebook The IPython Notebook is a web-based interactive computational environment where you can combine code execution, text, mathematics, plots and rich media into a single document. <img src="images/ipython_logo.png" width="400"> This is one of the 100 recipes of the ...
william-gray/data-science-python
ML-clustering/Related Article Clustering/Wikipedia_Related_Article_Clustering.ipynb
mit
import os from urllib import urlretrieve import graphlab URL = 'https://d396qusza40orc.cloudfront.net/phoenixassets/people_wiki.csv' def get_data(filename='people_wiki.csv', url=URL, force_download=False): """Download and cache the fremont data Parameters ---------- filename: string (optiona...
texib/deeplearning_homework
muki-batch.ipynb
mit
img_count = 0 def showimg(img): muki_pr = np.zeros((500,500,3)) l =img.tolist() count = 0 for x in range(500): for y in range(500): muki_pr[y][x] = l[count] count += 1 plt.imshow(muki_pr) def saveimg(fname,img): muki_pr = np.zeros((500,500,3)) l =img.tolist() ...