Skip to content

Instantly share code, notes, and snippets.

@HiKat
Last active September 25, 2019 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HiKat/60aa2df2bc25b980da344078fcf06c42 to your computer and use it in GitHub Desktop.
Save HiKat/60aa2df2bc25b980da344078fcf06c42 to your computer and use it in GitHub Desktop.
def plot(df):
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.hist(df['elapsed_time'], bins=100)
ax.set_title('first histogram')
ax.set_xlabel('x')
ax.set_ylabel('freq')
fig.show()
SUMMER_MONTH = [6, 7, 8]
WINTER_MONTH = [12, 1, 2]
def season_split(df):
summer_df = []
winter_df = []
for _e in zip(*[df[_col] for _col in df.columns.tolist()]):
month = iso2datetime(_e[6]).month
if month in SUMMER_MONTH:
summer_df.append(_e)
elif month in WINTER_MONTH:
winter_df.append(_e)
summer_df = pd.DataFrame(summer_df, columns=df.columns)
winter_df = pd.DataFrame(winter_df, columns=df.columns)
return summer_df, winter_df
summer_df_yabitu, winter_df_yabitu = season_split(df_yabitu)
plot(df_yabitu)
plot(summer_df_yabitu)
plot(winter_df_yabitu)
summer_df_jusan, winter_df_jusan = season_split(df_jusan)
plot(df_jusan)
plot(summer_df_jusan)
plot(winter_df_jusan)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment