从python中的数据帧创建散点图
我正在尝试从数据框架中创建一个散点图,但是我只能通过一些修改来实现它,而我无法使它起作用。
我的数据框如下。
1S | 2S | 1分钟 | |
---|---|---|---|
1月2日1月2日 | 0.1 | 0.4 | 0.3 |
1月18日18 | 0.2 | 0.2 0.2 | 0.2 0.2 |
1月1日18 | 0.3 | 0.2 | 0.1 |
我想创建的是每个时间间隔(sec/min)平均时间间隔的平均散点图。
在我的数据范围内,我的时间间隔最高30分钟。
我知道我可以将平均值添加到另一个数据框架中,并在分钟内分别调整时间间隔,但是是否有一种较短的方法可以做到这一点,而不是硬编码变量?
我假设.mean()将计算满足第一个条件的列均值,但是我不确定将minuets转换为plt.scatter()代码中的秒数的简短方法。
事先感谢您的任何帮助。
I am attempting to create a scatter plot from a data frame which alone I can do however with some modifications I cannot get it to work.
my data frame is as follows.
1s | 2s | 1min | |
---|---|---|---|
2 Jan 18 | 0.1 | 0.4 | 0.3 |
3 Jan 18 | 0.2 | 0.3 | 0.2 |
4 Jan 18 | 0.3 | 0.2 | 0.1 |
What I would like to create is a scatter plot of the average of each time interval (sec/min) plotted against the time interval in seconds.
In my data frame I have time intervals up to 30mins.
I know I could add the mean to another data frame and adjust the time intervals in mins to seconds separately, however is there a shorter way to do this that's not hardcoding variables?
I assume that .mean() will calculate the column means which satisfies the first condition but I am unsure of a short way to convert the minuets to seconds within the plt.scatter() code.
Thanks in advance for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案;
I have found a solution;