10월 1주차 파이썬 스터디
subplot # visualizaiton num_subplot = len(hotel.columns) ls_columns = list(hotel.columns) fig, axes = plt.subplots(nrows = (num_subplot // 4) + 1, ncols = 4, figsize = (16, 12)) plt.tight_layout(w_pad = 5, h_pad = 8) axes = axes.flatten() for i, col in enumerate(ls_columns): if hotel[col].dtype == "object": hotel[col].value_counts().plot(kind = "bar", ax = axes[i], color = "bisque") axes[i].set_title(col) axes[i].set_ylabel("count") axes[i].tick_params(axis = 'x', rotation = 45) else: hotel[col].plot(kind = "hist", ax = axes[i], bins = 100, color = "paleturquoise") axes[i].set_title(col) axes[i].tick_params(axis = 'x', rotation = 45)
3회 조회