Scattergl not drawing line with np.inf but only when in pd.Dataframe
オープン
まだ誰も着手していません。
bug
P2
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
Hello,
I’m having a strange issue where a graph_objects Figure with Scatergl is not drawing anything if there is an np.inf in the series, but only if the data is coming from a Pandas Dataframe. The below code shows an example of the issue (See 3rd figure). This issue appears with 6.0.0 install in python.
import plotly.express as px
import plotly.graph_objects as go
import numpy as np
import pandas as pd
# Create a DataFrame with np.inf in a column
df = pd.DataFrame({
'x': [0, 1, 2, 3, 4],
'y': [0, 1, 4, 9, np.inf],
})
# Create a line plot (Things are OK)
fig = px.line(data_frame=df, x='x', y='y', title='Looks OK')
fig.show()
# Create a line plot w/ Scatter (Things are OK)
fig = go.Figure()
fig.add_trace(go.Scatter(
x=df['x'],
y=df['y'],
mode='lines',
))
fig.update_layout(title=dict(text="Looks OK"),)
fig.show()
# Create a line plot w/ Scattergl (Nothing shown on figure...)
fig = go.Figure()
fig.add_trace(go.Scattergl(
x=df['x'],
y=df['y'],
mode='lines',
))
fig.update_layout(title=dict(text="Nothing displayed..."),)
fig.show()
# Create a line plot w/ Scattergl (This is ok.... to_list fixes something?)
fig = go.Figure()
fig.add_trace(go.Scattergl(
x=df['x'].to_list(),
y=df['y'].to_list(),
mode='lines',
))
fig.update_layout(title=dict(text="Looks OK"),)
fig.show()
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された Python の再現コードを plotly 6.0.0 で実行し、Scatter、Scattergl、リストに変換した入力を比較します。Scattergl が np.inf を含む Pandas Series からの線を他の例と一貫してレンダリングすれば、issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- pandas, python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100