Skip to content

Instantly share code, notes, and snippets.

View JIElite's full-sized avatar
😹

Jie-Han Chen JIElite

😹
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def __iter__(self)
# self.raw_list: record the absolute path for each wav file
for path in self.raw_list:
wav_tensor, sample_rate = torchaudio.load(path)
yield dict(wav=wav_tensor, sample_rate=sample_rate)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def encode_city_land_usage(x):
# Encode {'其他': 0, '住': 1, '農': 2, '工': 3, '商': 4,
# '住商': 5, '其他住宅': 6, nan: nan}
# nan remains
if not isinstance(x, str):
return x
if '非都市' in x:
return ""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "72f6f12b",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.