<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 QGrid
Interactive pandas dataframes
Step1:  Github
https
<ASSISTANT_TASK:>
Python Code:
df = pd.read_csv("../data/coal_prod_cleaned.csv")
df.head()
df.shape
df.columns
qgrid_widget = qgrid.show_grid(
    df[["Year", "Mine_State", "Labor_Hours", "Production_short_tons"]],
    show_toolbar=True,
)
qgrid_widget
df2 = df.groupby('Mine_State').sum()
df3 = df.groupby('Mine_State').sum()
df2.loc['Wyoming', 'Production_short_tons'] = 5.181732e+08
# have to run the next line then restart your kernel
# !cd ../insight; python setup.py develop
%aimport insight.plotting
insight.plotting.plot_prod_vs_hours(df2, color_index=1)
insight.plotting.plot_prod_vs_hours(df3, color_index=0)
def plot_prod_vs_hours(
    df, color_index=0, output_file="../img/production-vs-hours-worked.png"
):
    fig, ax = plt.subplots(figsize=(10, 8))
    sns.regplot(
        df["Labor_Hours"],
        df["Production_short_tons"],
        ax=ax,
        color=sns.color_palette()[color_index],
    )
    ax.set_xlabel("Labor Hours Worked")
    ax.set_ylabel("Total Amount Produced")
    x = ax.set_xlim(-9506023.213266129, 204993853.21326613)
    y = ax.set_ylim(-51476801.43653282, 746280580.4034251)
    fig.tight_layout()
    fig.savefig(output_file)
plot_prod_vs_hours(df2, color_index=0)
plot_prod_vs_hours(df3, color_index=1)
# make a change via qgrid
df3 = qgrid_widget.get_changed_df()
Explanation: QGrid
Interactive pandas dataframes: https://github.com/quantopian/qgrid
End of explanation
qgrid_widget = qgrid.show_grid(
    df2[["Year", "Labor_Hours", "Production_short_tons"]],
    show_toolbar=True,
)
qgrid_widget
Explanation: Github
https://github.com/jbwhit/jupyter-tips-and-tricks/commit/d3f2c0cef4dfd28eb3b9077595f14597a3022b1c?short_path=04303fc#diff-04303fce5e9bb38bcee25d12d9def22e
End of explanation
<END_TASK>