import polars as pl
import numpy as np
import plotly.express as px
= 1000000
n = np.random.normal(0, 1, n)
s = np.random.normal(0, 1, n)
h = pl.DataFrame({"value": s, "h": h}).with_columns(
df "h") > 0)
pl.when(pl.col("high"))
.then(pl.lit("low"))
.otherwise(pl.lit("high_low"),
.alias(0.5).alias("a"),
pl.lit(
).to_pandas()
=px.histogram(df,x="value",nbins=32,facet_row="high_low")
fig=0.5)
fig.add_vline(x"altair_histogram_trial18.png") fig.write_image(
1 ヒストグラム
保存したファイルを表示する
2 参考文献
3 Python version
import platform
"Python version "+platform.python_version()
'Python version 3.12.3'