python - pandas plot(kind='line') 创建散点图
问题描述
我正在尝试pandas
Series
用一条线绘制 a 。这些线产生所示的输出和散点图。
import pandas as pd
print(pd.__version__)
...
print(type(sam))
print(sam)
sam.plot(kind='line');
0.25.3
<class 'pandas.core.series.Series'>
3300 0.87
3301 0.87
3302 0.87
3303 0.87
3304 0.87
Name: A, dtype: float64
<<SCATTER PLOT>>
我无法通过任何方式创建线图Series.plot
。
正确的做法是什么?
PS:我可以想出一些变通方法,比如创建新的np
数组、列表等。但我想这应该可以马上工作。
PS2:我在 PortableApps 的 Chrome 下使用 Jupyter Lab。奇怪的是,在实验室的一个选项卡中(很少有东西),上面的线产生了一个线图,在另一个选项卡(sklearn
加载)中,它产生了一个散点图。我将进一步实验。
解决方案
推荐阅读
- c# - Serilog:restrictedToMinimumLevel 使用 LevelSwitches
- eddsa - 充气城堡 - 如何从 EdDSA 重建公钥
- flutter - 如何为 JOSN 编写模型?扑
- sql - 通过特定 id 更新后触发
- php - Docker php 镜像在 macos 上寻找 windows 路径
- android - 我可以在本机反应中使用 .jks 文件而不是 .keystore 文件吗?
- javascript - 使用已保存卡的令牌和 3d 安全创建付款
- node.js - 如何自定义 node js lib 并将其包含在项目中
- xamarin - Xamarin 自定义 ScrollView 的行为不像默认 Scrollview
- twincat - TwinCAT3 中的条件编译指示