Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View zerebom's full-sized avatar
🏂

Higuchi kokoro zerebom

🏂
View GitHub Profile
@zerebom
zerebom / encode_categorical.py
Last active March 22, 2020 05:22
reduce_mem_usage description
def encode_categorical(df, cols):
for col in cols:
# Leave NaN as it is.
le = LabelEncoder()
not_null = df[col][df[col].notnull()]
df[col] = pd.Series(le.fit_transform(not_null), index=not_null.index)
return df
@zerebom
zerebom / 00_readme.md
Last active April 14, 2020 03:42
SimpleITK

This repository describe 'SimpleITK' which python module is inheritence by 3D voxel image processing module 'ITK'

@zerebom
zerebom / 00_readme.md
Last active April 15, 2020 07:33
shell script

ゴミ箱を空にする

#ゴミ箱の場所
find ~ -name "Trash"
#ゴミ箱の中身確認
ls -al ~/.local/share/Trash/files
#全部消す
sudo rm -rf ~/.local/share/Trash/files/*
sudo rm -rf ~/.local/share/Trash/info/*
@zerebom
zerebom / 00_readme.md
Last active May 29, 2020 07:59
Matplotlib

[WIP]

@zerebom
zerebom / 00_timeseries.md
Last active September 16, 2020 15:16
Kaggle snippets

pandas

time split

test_df = df2[df2['arrival_date'] > datetime.datetime(2017,6,30)].reset_index()
train_df = df2[(df2['arrival_date'] > datetime.datetime(2016,5,30))&(df2['arrival_date'] < datetime.datetime(2016,8,30))].reset_index()

to_timedate

@zerebom
zerebom / 00_readme.md
Last active December 21, 2020 03:58
pandas

[WIP]

@zerebom
zerebom / instruction_handbook.md
Last active April 17, 2023 23:21
my instruction handbook

README for team members

この文章は、一緒のチームで仕事をする人に、自分がどんな人間か理解してもらうためのドキュメントです。

性格・強み

Strengths Finder

image

@zerebom
zerebom / async_gradio_app.py
Last active February 12, 2024 01:20
Async-open-ai-call-app-w-gradio
from typing import AsyncIterator
import gradio as gr
from openai import AsyncOpenAI
client = AsyncOpenAI()
async def fetch_gpt_response(
prompt: str, model: str = "gpt-3.5-turbo"