Skip to content

Instantly share code, notes, and snippets.

@austinogilvie
Created November 2, 2013 05:09
Show Gist options
  • Select an option

  • Save austinogilvie/7275770 to your computer and use it in GitHub Desktop.

Select an option

Save austinogilvie/7275770 to your computer and use it in GitHub Desktop.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from ggplot import meat
from statsmodels.nonparametric.smoothers_lowess import lowess
df = meat[['beef','veal']]
df = df.sort_index(by=['beef'])
x = meat.beef.values
y = meat.veal.values
x_loess, y_loess = lowess(y, x).T
plt.scatter(x, y)
plt.plot(x_loess, y_loess)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment