Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python for 循环 #5

Closed
JiaxiangBU opened this issue Sep 12, 2019 · 7 comments
Closed

Python for 循环 #5

JiaxiangBU opened this issue Sep 12, 2019 · 7 comments

Comments

@JiaxiangBU
Copy link
Owner

No description provided.

@JiaxiangBU
Copy link
Owner Author

fold = 0
for train_index, test_index in time_kfold.split(train):
    cv_train, cv_test = train.iloc[train_index], train.iloc[test_index]
    
    print('Fold :', fold)
    print('Train date range: from {} to {}'.format(cv_train.date.min(), cv_train.date.max()))
    print('Test date range: from {} to {}\n'.format(cv_test.date.min(), cv_test.date.max()))
    fold += 1

@JiaxiangBU
Copy link
Owner Author

JiaxiangBU commented Sep 12, 2019

def foo():
    cv_train, cv_test = train.iloc[train_index], train.iloc[test_index]
    
    print('Fold :', fold)
    print('Train date range: from {} to {}'.format(cv_train.date.min(), cv_train.date.max()))
    print('Test date range: from {} to {}\n'.format(cv_test.date.min(), cv_test.date.max()))
    fold += 1

@JiaxiangBU
Copy link
Owner Author

JiaxiangBU commented Sep 12, 2019

[foo() for a, b in xxx]

@JiaxiangBU
Copy link
Owner Author

(a,b).apply()

@JiaxiangBU
Copy link
Owner Author

mean(df)
df$a

@JiaxiangBU
Copy link
Owner Author

for (..) :
  mean(i)

@JiaxiangBU
Copy link
Owner Author

iter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant