Skip to content

Instantly share code, notes, and snippets.

View nilayparikh's full-sized avatar
🏠
Working from home

Nilay Parikh nilayparikh

🏠
Working from home
View GitHub Profile
prev_df = None
columns_to_check = ["o", "h", "l", "c", "v"]
while True:
result = client.query(
f"SELECT l_sym, rght, strk, exp, first_value(o) as o, max(h) AS h, min(l) AS l, last_value(c) as c, last_value(av) as av, count(*) as trades FROM {ch_table_name} WHERE sym='AAPL' GROUP BY l_sym, strk, exp, rght ORDER BY av DESC;"
)
df = pd.DataFrame(result.result_rows, columns=result.column_names)
@nilayparikh
nilayparikh / rule_base_validation.py
Last active December 16, 2023 15:18
Data Quality by Design: A Comprehensive Approach from Ingestion to Value Generation
import pandas as pd
from datetime import datetime
# Sample market options data
options_data = pd.DataFrame({
"symbol": ["XYZ", "XYZ", "XYZ"],
"expiration": ["2023-01-27", "2023-02-17", "2023-01-20"],
"strike": [35.00, 40.00, 45.00],
"bid": [1.05, 2.15, 0.95],
"ask": [1.15, 2.25, 1.05],
{
"value": [
{
"data": [
{
"timeStamp": "2017-04-25T21:20:00Z",
"average": 92.78
},
{
"timeStamp": "2017-04-25T21:21:00Z",
{
"value": [
{
"data": [
{
"timeStamp": "2017-04-25T20:30:00Z",
"average": 89.28
},
{
"timeStamp": "2017-04-25T20:31:00Z",
@nilayparikh
nilayparikh / deploy.ps1
Last active April 6, 2017 16:38
Guide: A Step-by-Step Guide to Setup Service Fabric Cluster in Azure
<#
.SYNOPSIS
Deploys a template to Azure
.DESCRIPTION
Deploys an Azure Resource Manager template
.PARAMETER subscriptionId
The subscription id where the template will be deployed.
@nilayparikh
nilayparikh / ConfigureVMDiskEncryption.ps1
Created March 11, 2017 19:19 — forked from chelnak/ConfigureVMDiskEncryption.ps1
Encrypt Azure VM Disks with PowerShell
<#
.SYNOPSIS
Enables disk encrption on a VM
.DESCRIPTION
Enables disk encryption on a VM. The script will create a new Key Vault, Azure Active Directory Application and Service principal
.PARAMETER ResourceGroupName
The name of the resource group that contains the key vault and virtual machine
@nilayparikh
nilayparikh / Migrate-AzureVM.ps1
Created March 6, 2017 12:36 — forked from scott-kloud/Migrate-AzureVM.ps1
Migrates a Azure Virtual Machine to another subscription or data centre
<#
.SYNOPSIS
Migrates a Azure Virtual Machine to another subscription or data centre
.DESCRIPTION
Shutsdown the source VM
Exports the VM config to a temporary file
Loops through all Azure disks attached to the source VM
Schedules an async copy of the underlying VHD to the destination storage account
- optionally overwrites existing VHD in destination if it exists
@nilayparikh
nilayparikh / deploy.ps1
Created March 6, 2017 12:36 — forked from srkirkland/deploy.ps1
TeamCity CI Deploy Azure PowerShell Script
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
Write-Output "Running Azure Imports"
@nilayparikh
nilayparikh / markup.html
Created March 4, 2015 15:57
Populate dropdown from SharePoint Site (JSOM)
<select name="departmentDD" title="department" id="departmentDD" onchange="populateDeapartment(this.value)">
@nilayparikh
nilayparikh / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console