# import sys
# sys.path.append("../")
import pandas as pd
from pyecharts.faker import Faker
from pandasecharts import echart
products = Faker.choose()
dfs = []
for year in (2012, 2013, 2014, 2015):
dfs.append(
pd.DataFrame(
zip(products, Faker.values(), Faker.values(), [year]*len(products)),
columns=["商品", "商家A", "商家B", "年份"]
)
)
df = pd.concat(dfs, axis=0)
df.head()
| 商品 | 商家A | 商家B | 年份 | |
|---|---|---|---|---|
| 0 | 小米 | 93 | 59 | 2012 |
| 1 | 三星 | 34 | 41 | 2012 |
| 2 | 华为 | 108 | 85 | 2012 |
| 3 | 苹果 | 51 | 64 | 2012 |
| 4 | 魅族 | 115 | 48 | 2012 |
df.echart.line3d("年份", "商品", "商家B", xtype="category", visualmap=True).render_notebook()
../pandasecharts/echart.py:357: UserWarning: Please specify argument ytype, 'category' is infered!
warnings.warn("Please specify argument ytype"
../pandasecharts/echart.py:361: UserWarning: Please specify argument ztype, 'value' is infered!
warnings.warn(f"Please specify argument ztype,"