code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Python Data Analysis
## Introduction
In this lab, we'll make use of everything we've learned about pandas, data cleaning, and simple data analysis. In order to complete this lab, you'll have to import, clean, combine, reshape, and visualize data to answer questions provided, as well as your own questions!
## Object... | github_jupyter |
```
import math
def init_computer(code, inputs):
return {
'mem': code.copy(),
'mem_size': len(code),
'extend_mem' : {},
'inst': 0,
'rel': 0,
'inputs': inputs.copy(),
'outputs': [],
'halt': False,
'needs_input': False
}
def read_mem(comput... | github_jupyter |
# Gradient Class Activation Map
```
import cv2
import numpy as np
import matplotlib.pyplot as plt
import json
import os
import pandas as pd
from pocovidnet.evaluate_covid19 import Evaluator
from pocovidnet.grad_cam import GradCAM
from pocovidnet.cam import get_class_activation_map
from pocovidnet.model import get_vgg1... | github_jupyter |
Derived from https://arxiv.org/pdf/1711.07128.pdf
```
import warnings
warnings.filterwarnings("ignore")
import sys
import os
import tensorflow as tf
# sys.path.append("../libs")
sys.path.insert(1, '../')
from libs import input_data
from libs import models
from libs import trainer
from libs import freeze
flags=tf.ap... | github_jupyter |
# Importing the large datasets to a postgresql server and computing their metrics
It is not possible to load the larger data sets in the memory of a local machine therefeore an alternative is to import them to a psql table and query them from there. By adding the right indices this can make the queries fast enough. Af... | github_jupyter |
<a href="https://colab.research.google.com/github/Ava100rav/shark-tank-india/blob/main/shark_tank_india.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from google.colab import drive
drive.mount('/content/drive')
import numpy as np
import pandas... | github_jupyter |
# "E is for Exploratory Data Analysis: Categorical Data"
> What is Exploratory Data Analysis (EDA), why is it done, and how do we do it in Python?
- toc: false
- badges: True
- comments: true
- categories: [E]
- hide: False
- image: images/e-is-for-eda-text/alphabet-close-up-communication-conceptual-278887.jpg
## _W... | github_jupyter |
```
from IPython.display import Image
import torch
import torch.nn as nn
import torch.nn.functional as F
import math, random
from scipy.optimize import linear_sum_assignment
from utils import NestedTensor, nested_tensor_from_tensor_list, MLP
Image(filename="figs/model.png", retina=True)
```
This notebook provides... | github_jupyter |
## Baltic test case configuration
Diagnostics output to close heat, salt, thickness budgets, and derive watermass transformation.
This notebook is a working space to explore that output.
```
import xarray as xr
import numpy as np
from xhistogram.xarray import histogram
### Data loading, grabbed from MOM6-analysis co... | github_jupyter |
## 1. Import necessary packages
For this exercise we need
* pandas
* train_test_split
* LogisticRegression
* pyplot from matplotlib
* KNeighborsClassifier
* LogisticRegressionClassifier
* RandomForestClassifier
* DummyClassifier
```
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seabor... | github_jupyter |
```
"""
@Time : 15/12/2020 19:01
@Author : Alaa Grable
"""
!pip install transformers==3.0.0
!pip install emoji
import gc
#import os
import emoji as emoji
import re
import string
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from sklearn.model_selection import train_test_split
from sklear... | github_jupyter |
```
# Convenient jupyter setup
%load_ext autoreload
%autoreload 2
from src.constants import GEDI_L2A_PATH
from src.utils.os import list_content
from src.utils.download import download
from tqdm.autonotebook import tqdm
import geopandas as gpd
save_dir = GEDI_L2A_PATH/ "v002" / "amazon_basin"
feather_files = list(save_d... | github_jupyter |
```
from pathlib import Path
import numpy as np
import pandas as pd
import swifter
import cleantext
pd.options.display.max_colwidth = 1000
OUT = Path('~/data/ynacc_proc/replicate/threads_last')
BASE_PATH = Path('/mnt/data/datasets/ydata-ynacc-v1_0')
ANN1 = BASE_PATH/'ydata-ynacc-v1_0_expert_annotations.tsv'
ANN2 = ... | github_jupyter |
Copyright 2020 Natasha A. Sahr, Andrew M. Olney and made available under [CC BY-SA](https://creativecommons.org/licenses/by-sa/4.0) for text and [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) for code.
# Ridge and Lasso Regression: L1 and L2 penalization
## Regularization
Up to this point, we've focused on... | github_jupyter |
```
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
from collections import defaultdict, Counter
import requests
import random
```
# Word cloud
```
data = [ ("big data", 100, 15), ("Hadoop", 95, 25), ("Python", 75, 50),
("R", 50, 40), ("machine learning", 80, 20), ("statistics", 20, 60),
... | github_jupyter |
```
import json
import pickle
from indra.literature.adeft_tools import universal_extract_text
from indra.databases.hgnc_client import get_hgnc_name, get_hgnc_id
from indra_db.util.content_scripts import get_text_content_from_pmids
from indra_db.util.content_scripts import get_stmts_with_agent_text_like
from indra_db.... | github_jupyter |
# ArterialVis Morphology Embedding and Animation
## Import the ArterialVis morphology module
```
from arterialvis.download import make_output_dir
from arterialvis.morphology import *
```
## Get a list of all morphology files
```
print(get_files.__doc__)
files = get_files()
```
## Create a directory to cache analyt... | github_jupyter |
```
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import gc
import json
import math
import cv2
import PIL
from PIL import Image
import seaborn as sns
sns.set(style='darkgrid')
from sklearn.preprocessing import LabelEncoder
from keras.utils import to_categoric... | github_jupyter |
# Intro to reimbursements: overview with visualization
This notebook provides an overview of the `2017-03-15-reimbursements.xz` dataset, which contains broad data regarding CEAP usage in all terms since 2009.
It aims to provide an example of basic analyses and visualization by exploring topics such as:
- Average mo... | github_jupyter |
**Copyright 2021 The TensorFlow Hub Authors.**
Licensed under the Apache License, Version 2.0 (the "License");
```
# Copyright 2021 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
def _if_near(point, mask, nearest_neighbor):
nn = nearest_neighbor
w,h = mask.shape
x,y = point
mask = np.pad(mask,nn,'edge')
x += nn
y += nn
if(w+nn>x and h+nn>y):
x_i,y_i = int(x+0.5),int(y+0.5)
#r... | github_jupyter |
# DC Python Tutorial 2: 10-19
Hint: If you are typing a function name and want to know what the options are for completing what you are typing, just hit the tab key for a menu of options.
Hint: If you want to see the source code associated with a function, you can do the following
import inspect
inspect.getsource(fo... | github_jupyter |
# Convolutional Neural Network
This notebook was created by Camille-Amaury JUGE, in order to better understand CNN principles and how they work.
(it follows the exercices proposed by Hadelin de Ponteves on Udemy : https://www.udemy.com/course/le-deep-learning-de-a-a-z/)
## Imports
```
import numpy as np
import pand... | github_jupyter |
# Object Detection API Demo
<table align="left"><td>
<a target="_blank" href="https://colab.sandbox.google.com/github/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb">
<img src="https://www.tensorflow.org/images/colab_logo_32px.png" />Run in Google Colab
</a>
</td><td>
... | github_jupyter |
# Name
Data preparation by using a template to submit a job to Cloud Dataflow
# Labels
GCP, Cloud Dataflow, Kubeflow, Pipeline
# Summary
A Kubeflow Pipeline component to prepare data by using a template to submit a job to Cloud Dataflow.
# Details
## Intended use
Use this component when you have a pre-built Cloud D... | github_jupyter |
### Problem 1
__We will use a full day worth of tweets as an input (there are total of 4.4M tweets in this file, but you only need to read 1M):__ http://rasinsrv07.cstcis.cti.depaul.edu/CSC455/OneDayOfTweets.txt
__a. Create a 3rd table incorporating the Geo table (in addition to tweet and user tables that you already... | github_jupyter |
<font size=6><b>Understand_Tables.ipynb:</b></font>
<p>
<font size=4>Extract Structured Information from Tables in PDF Documents
using IBM Watson Discovery and Text Extensions for Pandas
</font>
# Introduction
Many organizations have valuable information hidden in tables inside human-readable documents like P... | github_jupyter |
<a href="https://colab.research.google.com/github/ManojKesani/100-Days-Of-ML-Code/blob/master/Copy_of_basics.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<!--NAVIGATION-->
<a href="https://colab.research.google.com/github/saskeli/x/blob/master/... | github_jupyter |
# Tutorial of Node Schematas - PI & TwoSymbol
Visualization of schematas for simple boolean nodes (automatas)
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
from __future__ import division
import numpy as np
import pandas as pd
from IPython.display import Image, display
import cana
from cana.datasets.bools ... | github_jupyter |
# Simulate and Generate Empirical Distributions in Python
## Mini-Lab: Simulations, Empirical Distributions, Sampling
Welcome to your next mini-lab! Go ahead an run the following cell to get started. You can do that by clicking on the cell and then clickcing `Run` on the top bar. You can also just press `Shift` + `Ent... | github_jupyter |
# Lab 11 CNN(Convolutional Nueral Network)
## Lab11-0-cnn_basics
```
%matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
sess = tf.InteractiveSession()
image = np.array([[[[1],[2],[3]],
[[4],[5],[6]],
[[7],[8],[9]]]], dtype=np.float32)
p... | github_jupyter |
# Experiment set up
1. Create dataset: sequence of preporcessed examples ready to feed to neuralnet
2. Create dataloader: define how dataset is loaded to neuralnet (batch size, order, computation optimizing ...)
3. Create model : a bunch of matrixes math to transform input tensor to output tensor
4. Training:
+ Fo... | github_jupyter |
Cognizant Data Science Summit 2020 : July 1, 2020
Yogesh Deshpande [157456]
# Week 1 challenge - Python
Description
The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row,... | github_jupyter |
# Language Translation
In this project, you’re going to take a peek into the realm of neural network machine translation. You’ll be training a sequence to sequence model on a dataset of English and French sentences that can translate new sentences from English to French.
## Get the Data
Since translating the whole lan... | github_jupyter |
# 🔬 Sequence Comparison of DNA using `BioPython`
### 🦠 `Covid-19`, `SARS`, `MERS`, and `Ebola`
#### Analysis Techniques:
* Compare their DNA sequence and Protein (Amino Acid) sequence
* GC Content
* Freq of Each Amino Acids
* Find similarity between them
* Alignment
* hamming distance
* 3D structure of each
|... | github_jupyter |
<span style="font-size:20pt;color:blue">Add title here</span>
This is a sample file of interactive stopped-flow data analysis. You do <b>NOT</b> need to understand python language to use this program. By replacing file names and options with your own, you can easily produce figures and interactively adjust plotting op... | github_jupyter |
```
# supresses future warnings - See References #1
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
# Import the pandas library for df creation
import pandas as pd
# Import the NumPy library to use the random package
import numpy as np
#... | github_jupyter |
# Monetary Economics: Chapter 5
### Preliminaries
```
# This line configures matplotlib to show figures embedded in the notebook,
# instead of opening a new window for each figure. More about that later.
# If you are using an old version of IPython, try using '%pylab inline' instead.
%matplotlib inline
import matp... | github_jupyter |
# `Cannabis (drug)`
#### `INFORMATION`:
### Everything we need to know about marijuana (cannabis)
>`Cannabis, also known as marijuana among other names, is a psychoactive drug from the Cannabis plant used for medical or recreational purposes. The main psychoactive part of cannabis is tetrahydrocannabinol (THC), one ... | github_jupyter |
##### week1-Q1.
What does the analogy “AI is the new electricity” refer to?
1. Through the “smart grid”, AI is delivering a new wave of electricity.
2. AI runs on computers and is thus powered by electricity, but it is letting computers do things not possible before.
3. Similar to electricity starting about 100 years... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
%matplotlib inline
sns.set_style("whitegrid")
plt.style.use("fivethirtyeight")
df = pd.read_csv('diabetes.csv')
df[0:10]
pd.set_option("display.float", "{:.2f}".format)
df.describe()
df.info()
missing_values_count = df.isnu... | github_jupyter |
# Importing the Libraries
```
import numpy as np
import pandas as pd
import tensorflow as tf
import seaborn as sns
from scipy import interp
import matplotlib.pyplot as plt
from itertools import cycle
# Importing the Keras libraries and packages
from tensorflow.keras.models import Sequential
from tensorflow.keras.laye... | github_jupyter |
```
import sys
sys.path.append('../scripts/')
from mcl import *
from kf import *
class EstimatedLandmark(Landmark):
def __init__(self):
super().__init__(0,0)
self.cov = None
def draw(self, ax, elems):
if self.cov is None:
return
##推定位置に青い星を描く##
... | github_jupyter |
# Welcome to Enterprise-Scale!
## Verify Pre-req
Powershell Version > 7.0
```
$psversiontable
```
Git Version > 2.24
```
git --version
```
## Login to Azure
Clear Azure Context
```
Clear-AzContext -Force
```
Login to Azure with SPN or User Account that has permission at '/' scope
```
$user = ""
$password = ""... | github_jupyter |
# **밑바닥부터 시작하는 데이터과학**
Data Science from Scratch
- https://github.com/joelgrus/data-science-from-scratch/blob/master/first-edition/code-python3/network_analysis.py
## **선형대수 작업에 필요한 함수**
앞에서 작업했던 함수들을 호출 합니다
```
# linear_algebra.py
def dot(v, w):
return sum(v_i * w_i for v_i, w_i in zip(v, w))
def squared_distan... | github_jupyter |
Put `coveval` folder into our path for easy import of modules:
```
import sys
sys.path.append('../')
```
# Load data
```
from coveval import utils
from coveval.connectors import generic
```
Let's load some data corresponding to the state of New-York and look at the number of daily fatalities:
```
df_reported = uti... | github_jupyter |
```
# default_exp dl_101
```
# Deep learning 101 with Pytorch and fastai
> Some code and text snippets have been extracted from the book [\"Deep Learning for Coders with Fastai and Pytorch: AI Applications Without a PhD\"](https://course.fast.ai/), and from these blog posts [[ref1](https://muellerzr.github.io/fastblo... | github_jupyter |
## Program that searches for Bars nearby
starting coordinates: Home - Romero y Cordero 209
```
import requests # library to handle requests
import pandas as pd # library for data analsysis
import numpy as np # library to handle data in a vectorized manner
import random # library for random number generation
from geo... | github_jupyter |
# CNN - Example 01
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
```
### Load Keras Dataset
```
from tensorflow.keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
```
#### Visualize data
```
print(x_train.shape)
single_image = x_train[0]
print(single_i... | github_jupyter |
### Note
* Instructions have been included for each segment. You do not have to follow them exactly, but they are included to help you think through the steps.
```
# Dependencies and Setup
import pandas as pd
# File to Load (Remember to Change These)
file_to_load = "Resources/purchase_data.csv"
# Read Purchasing Fil... | github_jupyter |
## Data Distillation
In this notebook we train models using data distillation.
```
from google.colab import drive
drive.mount('/content/drive')
from google.colab import files
uploaded = files.upload()
!unzip dataset.zip -d dataset
import warnings
import os
import shutil
import glob
import random
import random
import ... | github_jupyter |
```
# default_exp utils_blitz
```
# uitls_blitz
> API details.
```
#export
#hide
from blitz.modules import BayesianLinear
from blitz.modules import BayesianEmbedding, BayesianConv1d, BayesianConv2d, BayesianConv3d
from blitz.modules.base_bayesian_module import BayesianModule
from torch import nn
import torch
from fa... | github_jupyter |
```
###########
# PRELUDE #
###########
# auto-reload changed python files
%load_ext autoreload
%autoreload 2
# Format cells with %%black
%load_ext blackcellmagic
# nice interactive plots
%matplotlib inline
# add repository directory to include path
from pathlib import Path
import sys
PROJECT_DIR = Path('../..').re... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import statistics
rep5_04_002_data = pd.read_csv('proc_rep5_04_002.csv')
del rep5_04_002_data['Unnamed: 0']
rep5_04_002_data
rgg_rgg_data = rep5_04_002_data.copy()
rgg_rand_data = rep5_04_002_data.copy()
rand_rgg_data = rep5_04_002_data.copy()
... | github_jupyter |
# 卷积神经网络示例与各层可视化
```
import os
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
%matplotlib inline
print ("当前TensorFlow版本为 [%s]" % (tf.__version__))
print ("所有包载入完毕")
```
## 载入 MNIST
```
mnist = input_data.read_data_sets('data/', ... | github_jupyter |
Python语言进阶
```
"""
查找 - 顺序查找和二分查找
算法:解决问题的方法(步骤)
评价一个算法的好坏主要指标:渐进时间复杂度和空间复杂度,通常一个算法很难到时间复杂度和空间复杂度都很低(因为时间和空间是不可调和 的矛盾)
表示渐进时间复杂度通常用大o标记
o(c):常量时间复杂度 - 哈希存储/布隆过滤器
o(log_2 n):对数时间复杂度 - 折半查找
o(n):线性时间复杂度 - 顺序查找
o(n * log_2 n):对数线性时间复杂度 - 高级排序算法(归并算法,快速排序)
o(n ** 2):平方时间复杂度 - 简单排序算法(冒泡排序。选择排序。插入排序 )
o(n ** 3): 立方时间复杂度 - F... | github_jupyter |
# TV Script Generation
In this project, you'll generate your own [Simpsons](https://en.wikipedia.org/wiki/The_Simpsons) TV scripts using RNNs. You'll be using part of the [Simpsons dataset](https://www.kaggle.com/wcukierski/the-simpsons-by-the-data) of scripts from 27 seasons. The Neural Network you'll build will gen... | github_jupyter |
### How to Find Your Neighbor?
In neighborhood based collaborative filtering, it is incredibly important to be able to identify an individual's neighbors. Let's look at a small dataset in order to understand, how we can use different metrics to identify close neighbors.
```
%load_ext lab_black
from itertools import ... | github_jupyter |
```
%run startup.py
%%javascript
$.getScript('./assets/js/ipython_notebook_toc.js')
```
# A Decision Tree of Observable Operators
## Part 1: NEW Observables.
> source: http://reactivex.io/documentation/operators.html#tree.
> (transcribed to RxPY 1.5.7, Py2.7 / 2016-12, Gunther Klessinger, [axiros](http://www.axiro... | github_jupyter |
#### Copyright 2017 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 obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | github_jupyter |
## Special Topics - Introduction to Deep Learning
#### Prof. Thomas da Silva Paula
### Feature extraction example
* Using Keras
* Using VGG-16
## Imports
```
import os
import numpy as np
import matplotlib.pyplot as plt
from keras.preprocessing import image
from keras.applications.vgg16 import VGG16
from keras.app... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
sns.set_style('whitegrid')
warnings.filterwarnings('ignore')
df = pd.read_csv('../input/bigmarket/bigmarket.csv')
df.head()
df.shape
df.info()
```
**# checking for missing values****
```
df.isnull().sum()
... | github_jupyter |
```
import phys
import phys.newton
import phys.light
import numpy as np
import time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
class ScatterDeleteStep2(phys.Step):
def __init__(self, n, A):
self.n = n
self.A = A
self.built = False
def run(self, sim)... | github_jupyter |
<table style="float:left; border:none">
<tr style="border:none">
<td style="border:none">
<a href="https://bokeh.org/">
<img
src="assets/bokeh-transparent.png"
style="width:50px"
>
</a>
</td>
<td style="border:n... | github_jupyter |
```
# code by Tae Hwan Jung @graykode
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
class TextCNN(nn.Module):
def __init__(self):
super(TextCNN, self).__init__()
self.num_filters_total = num_filters * len(filter_sizes)
self... | github_jupyter |
# Testing cosmogan
Aug 25, 2020
Borrowing pieces of code from :
- https://github.com/pytorch/tutorials/blob/11569e0db3599ac214b03e01956c2971b02c64ce/beginner_source/dcgan_faces_tutorial.py
- https://github.com/exalearn/epiCorvid/tree/master/cGAN
```
import os
import random
import logging
import sys
import torch
im... | github_jupyter |
## Programming Exercise 1 - Linear Regression
- [warmUpExercise](#warmUpExercise)
- [Linear regression with one variable](#Linear-regression-with-one-variable)
- [Gradient Descent](#Gradient-Descent)
```
# %load ../../standard_import.txt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from skl... | github_jupyter |
# BEL to Natural Language
**Author:** [Charles Tapley Hoyt](https://github.com/cthoyt/)
**Estimated Run Time:** 5 seconds
This notebook shows how the PyBEL-INDRA integration can be used to turn a BEL graph into natural language. Special thanks to John Bachman and Ben Gyori for all of their efforts in making this pos... | github_jupyter |
# Basic Examples with Different Protocols
## Prerequisites
* A kubernetes cluster with kubectl configured
* curl
* grpcurl
* pygmentize
## Examples
* [Seldon Protocol](#Seldon-Protocol-Model)
* [Tensorflow Protocol](#Tensorflow-Protocol-Model)
* [KFServing V2 Protocol](#KFServing-V2-Protocol-Model)
##... | github_jupyter |
```
from tensorflow import keras
from tensorflow.keras import *
from tensorflow.keras.models import *
from tensorflow.keras.layers import *
from tensorflow.keras.regularizers import l2#正则化L2
import tensorflow as tf
import numpy as np
import pandas as pd
# 12-0.2
# 13-2.4
# 18-12.14
import pandas as pd
import numpy as n... | github_jupyter |
# OpenEO Use Case 2: Multi–source phenology toolbox
Use case implemented by VITO.
## Official description
This use case concentrates on data fusion tools, time-series generation and phenological
metrics using Sentinel-2 data. It will be tested on several back-end platforms by pilot users from
the Action against Hunge... | github_jupyter |
# Capstone Project
## Image classifier for the SVHN dataset
### Instructions
In this notebook, you will create a neural network that classifies real-world images digits. You will use concepts from throughout this course in building, training, testing, validating and saving your Tensorflow classifier model.
This proje... | github_jupyter |
# Keras exercise
In this exercise you will be creating a Keras model by loading a data set, preprocessing input data, building a Sequential Keras model and compiling the model with a training configuration. Afterwards, you train your model on the training data and evaluate it on the test set. To finish this exercise, ... | github_jupyter |
# NumPy Array Basics - Multi-dimensional Arrays
```
import sys
print(sys.version)
import numpy as np
print(np.__version__)
npa = np.arange(25)
npa
```
We learned in the last video how to generate arrays, now let’s generate multidimensional arrays. These are, as you might guess, arrays with multiple dimensions.
We ca... | github_jupyter |
<a href="https://colab.research.google.com/github/RSid8/SMM4H21/blob/main/Task1a.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#Importing the Libraries and Models
```
from google.colab import drive
drive.mount('/content/drive')
!pip install fairs... | github_jupyter |
```
# imports
import warnings
warnings. filterwarnings('ignore')
import numpy
from qpsolvers import solve_qp
from qiskit.chemistry import FermionicOperator
from qiskit.aqua.operators.legacy.op_converter import to_weighted_pauli_operator
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.aqua.... | github_jupyter |
# Malware Analysis & Triage Kit
This notebook performs the initial stages of immediate malware triage.
## How To
Take your malware specimen and drop it into the `dropbox` directory. The notebook will walk you through the stages of initial analysis.
At the end of this process, you will have a triage report in the `sav... | github_jupyter |
```
import intake
import xarray as xr
import os
import pandas as pd
import numpy as np
import zarr
import rhg_compute_tools.kubernetes as rhgk
import warnings
warnings.filterwarnings("ignore")
write_direc = '/gcs/rhg-data/climate/downscaled/workdir'
client, cluster = rhgk.get_standard_cluster()
cluster
```
get some ... | github_jupyter |
## Observations and Insights
```
# Dependencies and Setup
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as st
# Study data files
mouse_metadata_path = "data/Mouse_metadata.csv"
study_results_path = "data/Study_results.csv"
# Read the mouse data and the study results
mouse_metadata = pd.read_... | github_jupyter |
# Gymnasion Data Processing
Here I'm going to mine some chunk of Project Gutenberg texts for `(adj,noun)` and `(noun,verb,object)` relations using mostly SpaCy and textacy. Extracting them is easy. Filtering out the chaff is not so easy.
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tqdm import tqdm
import... | github_jupyter |
# T1129 - Shared Modules
Adversaries may abuse shared modules to execute malicious payloads. The Windows module loader can be instructed to load DLLs from arbitrary local paths and arbitrary Universal Naming Convention (UNC) network paths. This functionality resides in NTDLL.dll and is part of the Windows [Native API](... | github_jupyter |
```
from tc_python import *
import itertools as itertool
import time
import numpy as np
import matplotlib.pyplot as plt
def singlePoint(database=["tcfe9"],T=[273],P=[1e5],components=["fe","c"],phases=["bcc"],mole_fractions=[99.02,0.08]):
"""
Single point equilibrium calculations
## input:
data... | github_jupyter |
# <center>Master M2 MVA 2017/2018 - Graphical models - HWK 3<center/>
### <center>WANG Yifan && CHU Xiao<center/>
```
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.stats import multivariate_normal as norm
import warnings
warnings.filterwarnings("ignore")
# Data loading
data_pat... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Project: **Finding Lane Lines on the Road**
***
In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j... | github_jupyter |
Adapted from [https://github.com/PacktPublishing/Bioinformatics-with-Python-Cookbook-Second-Edition](https://github.com/PacktPublishing/Bioinformatics-with-Python-Cookbook-Second-Edition), Chapter 2.
# Getting the necessary packages
```
conda config --add channels bioconda
conda install samtools pysam
```
# Getting ... | github_jupyter |
# CNN study case: train on Cifar10.
On this notebook we will cover the training of a simple model on the CIFAR 10 dataset, and we will cover the next topics:
- Cifar10 dataset
- Model architecture:
- 2D Convolutional layers
- MaxPooling
- Relu activation
- Batch normalization
- Image generator data au... | github_jupyter |
# Predicting Heart Disease using Machine Learning
This notebook uses various Python based machine learning and data science libraries in an attempt to build a machine learning model capable of predicting whether or not someone has a Heart Disease based on their medical attributes.
We're going to take the following ap... | github_jupyter |
# Keras Callbacks and Functional API
```
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Dropout
from keras.optimizers import SGD, RMSprop
from keras.callbacks import EarlyStopping, TensorBoard, ModelCheckpoint
import numpy as np
%matplotlib inli... | github_jupyter |
<pre>
Torch : Manipulating vectors like dot product, addition etc and using GPU
Numpy : Manipuliting vectors
Pandas : Reading CSV file
Matplotlib : Plotting figure
</pre>
```
import numpy as np
import torch
import pandas as pd
from matplotlib import pyplot as plt
```
<pre>
O
... | github_jupyter |
# Step 0.0. Install LightAutoML
Uncomment if doesn't clone repository by git. (ex.: colab, kaggle version)
```
#! pip install -U lightautoml
```
# Step 0.1. Import necessary libraries
```
# Standard python libraries
import logging
import os
import time
import requests
logging.basicConfig(format='[%(asctime)s] (%(le... | github_jupyter |
# Data Space Report
<img src="images/polito_logo.png" alt="Polito Logo" style="width: 200px;"/>
## Pittsburgh Bridges Data Set
<img src="images/andy_warhol_bridge.jpg" alt="Andy Warhol Bridge" style="width: 200px;"/>
Andy Warhol Bridge - Pittsburgh.
Report created by Student Francesco Maria Chiarlo s253666, ... | github_jupyter |
# Load Dataset and Important Libraries
```
import pandas as pd
import numpy as np
from scipy import stats
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rc('axes', labelsize=14)
mpl.rc('xtick', labelsize=12)
mpl.rc('ytick', labelsize=12)
np.random.seed(42) # some functions like scipy.s... | github_jupyter |
##### Copyright 2018 The TensorFlow Authors.
```
#@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 ... | github_jupyter |
# 6. Pandas Introduction
In the previous chapters, we have learned how to handle Numpy arrays that can be used to efficiently perform numerical calculations. Those arrays are however homogeneous structures i.e. they can only contain one type of data. Also, even if we have a single type of data, the different rows or c... | github_jupyter |
<a href="https://colab.research.google.com/github/avitripathi15/starter-hugo-academic/blob/master/flower_recognition_alternate.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import matplotlib.pyplot as plt
import numpy as np
import os
import PI... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.io as scio
from sklearn.linear_model import Ridge
%load_ext autoreload
%autoreload 2
import main
mat = scio.loadmat('ex9_movies.mat')
# TODO: mean normalization: rows, columns and total
# TODO: only calculate the mean for present ... | github_jupyter |
# Facial Emotion Recognition (Model Training)
This dataset consists of 48*48 pixel grayscale face images.
The images are centered and occupy an equal amount of space.
The dataset consists of 7 categories:
0. angry
1. disgust (removed)
2. fear
3. happy
4. sad
5. surprise
6. neutral
Training set: 28,709 samples
Publi... | github_jupyter |
This notebook has been adapted from the [spam example](https://github.com/snorkel-team/snorkel-tutorials/blob/master/spam/01_spam_tutorial.ipynb) of the [snorkel examples github](https://github.com/snorkel-team/snorkel-tutorials). Please visit the official snorkel tutorials [link](https://github.com/snorkel-team/snorke... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Import-the-json-and-pprint-libraries" data-toc-modified-id="Import-the-json-and-pprint-libraries-1"><span class="toc-item-num">1 </span>Import the json and pprint libraries</a></span></li><li><sp... | github_jupyter |
<style>div.container { width: 100% }</style>
<img style="float:left; vertical-align:text-bottom;" height="65" width="172" src="../assets/holoviz-logo-unstacked.svg" />
<div style="float:right; vertical-align:text-bottom;"><h2>Tutorial 0. Setup</h2></div>
This first step to the tutorial will make sure your system is s... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.