[~] Refactor
This commit is contained in:
parent
c04d31c640
commit
9555652209
@ -37,26 +37,31 @@ def kernel_1():
|
|||||||
t3=t3,
|
t3=t3,
|
||||||
)
|
)
|
||||||
|
|
||||||
def kernel_2(o_1):
|
def kernel_2(
|
||||||
t2 = '/kaggle/input/mlb-player-digital-engagement-forecasting/train.csv'
|
o_1=None,
|
||||||
t1 = {
|
):
|
||||||
k : pandas.DataFrame(
|
t1 = {}
|
||||||
sum(
|
|
||||||
[
|
for k in [
|
||||||
json.loads(o)
|
'playerTwitterFollowers',
|
||||||
for o in o_1['t3'][t2][k].values
|
'teamTwitterFollowers',
|
||||||
if isinstance(o, str)
|
'games',
|
||||||
],
|
'events'
|
||||||
[]
|
]:
|
||||||
)
|
t4 = '%s.nc' % k
|
||||||
).to_xarray()
|
if not os.path.exists(k):
|
||||||
for k in [
|
t2 = '/kaggle/input/mlb-player-digital-engagement-forecasting/train.csv'
|
||||||
'playerTwitterFollowers',
|
t3 = pandas.DataFrame(
|
||||||
'teamTwitterFollowers',
|
sum(
|
||||||
'games',
|
[
|
||||||
'events'
|
json.loads(o)
|
||||||
]
|
for o in o_1['t3'][t2][k].values
|
||||||
}
|
if isinstance(o, str)
|
||||||
|
],
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
).to_xarray()
|
||||||
|
t1[k] = xarray.load_dataset(t4)
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
t1=t1,
|
t1=t1,
|
||||||
|
Loading…
Reference in New Issue
Block a user