plotly express: multiple data-series in same column -> plot in one figure

I have a table with sequential y-values

name_a val1 
name_a val2
name_b val3 
name_b val4 

I want to plot the y-values sequentially in a scatter or line plot and compare series "name1" against series "name2".

Sound simple, but somehow I cannot solve it. Here is what I tried so far

import pandas as pd
import plotly.express as px

# prepare data
df = pd.read_csv(filename_results, delimiter=',', header=None)
df_subset_a = df.loc[df[1] == 'name_a']
df_subset_b = df.loc[df[1] == 'name_b']

values_a = df_subset_a.loc[:,1];
values_b = df_subset_b.loc[:,1];

fig = px.scatter(y=values_a); 

Now how do I add the second series "values_b" to the same figure



from Recent Questions - Stack Overflow https://ift.tt/3mIy2dY
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)