BASE_URL
'https://fed-ledger-prod.flock.io/api/v1/'
source
check_flock ()
check_flock()
True
get_gpu_info ()
gpu_info = get_gpu_info() assert isinstance(gpu_info, AttrDict) test_eq(gpu_info.gpu_count, 0) test_eq(gpu_info.cuda_available, False) gpu_info
{'cuda_available': False, 'gpu_count': 0}
We can convert one-level nested JSON object with pd.json_normalize.
pd.json_normalize
pd_parse (d)
df = pd_parse({"Feature 1": {"sub": "Hey", "sub2": "You"}, "Feature 2": {"sub": "Hey", "sub2": "You"}}) df
test_eq(df.columns.tolist(), ["Feature 1_sub", "Feature 1_sub2", "Feature 2_sub", "Feature 2_sub2"]) test_eq(df.iloc[0]["Feature 1_sub2"], "You")