Really new to the Jupyter/Pandas/Plotly ecosystem. Successfully reading in dataframes and calculating some new columns with success. Trying to do a simple scatter plot with a single variable.
X Variable is DeltaTimeSeconds - pretty much just monotonically increasing value
df['DeltaTimeSeconds'].describe()
count 28735.000000
mean 14429.311258
std 8301.268089
min 0.000000
25% 7249.500000
50% 14433.000000
75% 21616.500000
max 28800.000000
Name: DeltaTimeSeconds, dtype: float64
Y Variable is AI01 - a floating-point measured value from a piece of manufacturing equipment
df['AI01'].describe()
count 28735.000000
mean 7613.120717
std 6526.985839
min 6.747771
25% 2126.074707
50% 3712.778809
75% 13935.562010
max 19550.572270
Name: AI01, dtype: float64
Straight from Jupyter Lab Github Page with minor tweak for my dataset
from IPython.display import display
def Plotly(data=[], layout={}):
bundle = {}
bundle['application/vnd.plotly.v1+json'] = {
'data': data,
'layout': layout,
}
display(bundle, raw=True)
data = [
{'x': df['DeltaTimeSeconds'], 'y': df['AI01'], 'type': 'scatter'}
]
layout = {
'title': 'AI01',
'xaxis': {'title': 'DeltaTime', 'showgrid': False, 'zeroline': False},
'yaxis': {'title': 'AI01', 'showline': False}
}
Plotly(data, layout)
and I get this error
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\jsonutil.py in json_clean(obj)
195
196 # we don't understand it, it's probably an unserializable object
--> 197 raise ValueError("Can't clean for JSON: %r" % obj)
ValueError: Can't clean for JSON: 0 0
1 1
I doubled back and cleaned up some null rows from AI01 so I shouldn’t have any null data in AI01.
I’m suspecting I’m making a rookie mistake that I just can’t see right now.
Many thanks in advance for a nudge in the right direction. Once I get through this one I have a much more complex question that may actually challenge the group, I promise