plotly绘图 自于pandas

Published on Aug. 22, 2023, 12:07 p.m.

plotly 绘图 数据来自于 #pandas

<h1>imports</h1>
import plotly.express as px 
import pandas as pd 
import numpy as np 
<h1>data</h1>
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
fig = px.line(df, x='Date', y=df.columns[1:-6])
<h1>Show plot</h1>
fig.show()

https://stackoverflow.com/questions/58142058/how-to-plot-multiple-lines-on-the-same-y-axis-using-plotly-express-in-python
筛选列名为a、b、c的列,形成新的df1
====================

df1 \= df[[‘a’,’b’,’c’]]

Tags: