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

This code is not working in chapter 2 #2

Open
Samastaraki opened this issue Oct 21, 2022 · 0 comments
Open

This code is not working in chapter 2 #2

Samastaraki opened this issue Oct 21, 2022 · 0 comments

Comments

@Samastaraki
Copy link

import pandas as pd
import numpy as np
np.random.seed(123) # fix the random numbers
x=np.arange(1, 10.1, .25)**2
n=np.size(x)
y = pd.Series(x + np.random.randn(n))
bad=np.array([4,13,14,15,16,20,30])
x[bad] = np.nan # missing code is np.nan
methods = ['linear', 'quadratic', 'cubic']
df = pd.DataFrame({m: x.interpolate(method=m) for m in methods})
df.plot()

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

No branches or pull requests

1 participant