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

ecdf = sm.distributions.ECDF(sample) #3

Open
dick7 opened this issue Jan 15, 2018 · 3 comments
Open

ecdf = sm.distributions.ECDF(sample) #3

dick7 opened this issue Jan 15, 2018 · 3 comments

Comments

@dick7
Copy link

dick7 commented Jan 15, 2018

NameError: name 'sm' is not defined
请问‘sm’在哪里定义的,代表什么意思?

@cqcn1991
Copy link
Owner

@dick7 话说这段代码在哪...这个应该是以前的代码

新版是这样的了

def fit_weibull_and_ecdf(df_speed, x=None):
    from statsmodels.distributions.empirical_distribution import ECDF
    max_speed = df_speed.max()
    if x is None:
        x = linspace(0, max_speed, 20)
    # Fit Weibull, notice loc value 0 or not
    weibull_params, y_weibull, density_expected_weibull, y_cdf_weibull = fit_weibull(df_speed, x)
    # Fit Ecdf
    y_ecdf = ECDF(df_speed)(x)
    return x, y_weibull, density_expected_weibull, y_cdf_weibull, weibull_params, y_ecdf

ECDF来自于statsmodels 这个包

@dick7
Copy link
Author

dick7 commented Jan 15, 2018

是啊,是你以前的版本了

@cqcn1991
Copy link
Owner

@dick7 换新版本吧...

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

2 participants