Hello, guys,
Part of the code in candlstick.py in the gallery, I just don’t understand. And I could not find any references or posts that explain it.
Below are some of the code:
df = pd.DataFrame(MSFT)[:50]
df["date"] = pd.to_datetime(df["date"])
inc = df.close > df.open
dec = df.open > df.close
p = figure(x_axis_type="datetime", tools=TOOLS, plot_width=1000, title = "MSFT Candlestick")
p.segment(df.date, df.high, df.date, df.low, color="black")
p.vbar(df.date[inc], w, df.open[inc], df.close[inc], fill_color="#D5E1DD", line_color="black")
p.vbar(df.date[dec], w, df.open[dec], df.close[dec], fill_color="#F2583E", line_color="black")
What does df.date[inc]
mean in
p.vbar(df.date[inc], w, df.open[inc], df.close[inc],
fill_color="#D5E1DD", line_color="black")
Why there is a boolean value “inc” in the bracket after df.date, df.open? And where can I find introductions of this.
Thanks a lot,
Ron