Skip to content

Instantly share code, notes, and snippets.

View toandaominh1997's full-sized avatar
🎯
Focusing

Henry toandaominh1997

🎯
Focusing
View GitHub Profile
import pandas as pd
def split_dataframe(df, chunk_size, file_name = "shopee"):
"""
Splits a Dataframe into smaller chunks of a specified size and saves each chunk as a separate CSV file.
Parameters:
- df (pandas.DataFrame): The DataFrame to be split.
- chunk_size (int): The number of rows each chunk should contain.
- file_name (str, optional): The base name for the output CSV files. Defaults to "shopee".
@toandaominh1997
toandaominh1997 / artifacts...EtherWallet.json
Created November 26, 2022 09:29
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
\documentclass[letterpaper,11pt]{article}
\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage[hidelinks]{hyperref}
from functools import wraps
import pandas as pd
import numpy as np
from pandas import DataFrame, Series
def inputvalidator(input_="ohlc"):
def dfcheck(func):
@wraps(func)
def wrap(*args, **kwargs):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
numpy
pandas
scipy
# visualization
matplotlib
seaborn
plotly
yellowbrick
# cloud service
google-cloud-bigquery
@toandaominh1997
toandaominh1997 / a.py
Last active September 20, 2020 02:33
test github cli
import threading
x = 0
def increament(): global x x +=1
def thread_task(lock): for _ in range(100000):
lock.acquire() increament() lock.release()
def main_task(): global x x = 0 lock = threading.Lock() t1 = threading.Thread(target=thread_task, args=(lock, )) t2 = threading.Thread(target=thread_task, args=(lock, )) t3 =
import threading
x = 0
def increament():
global x
x +=1
def thread_task(lock):
for _ in range(100000):
{
//
// EDITOR CONFIG
//
"editor.fontSize": 12,
"editor.lineHeight": 0,
"editor.lineNumbers": true,
"editor.tabSize": 4,
class DBMongo{
constructor(url){
this.url = url
this.MongoClient = require('mongodb').MongoClient;
}
createcollection(clt="hardware", dbase="mydb"){
this.MongoClient.connect(this.url, function(err, db){
if(err) throw err;
var dbo = db.db(dbase)