Python 熊猫不是那种动物。”;“行”;
我试着用记号笔画线,但熊猫只是把记号笔还给我。有什么解决办法吗Python 熊猫不是那种动物。”;“行”;,python,pandas,matplotlib,Python,Pandas,Matplotlib,我试着用记号笔画线,但熊猫只是把记号笔还给我。有什么解决办法吗 sns.set() sns.set(rc={"figure.figsize": (16, 8)}) df_payback_days_to_start.plot(kind="line",legend=False, marker=".") plt.xlabel("Days for Event Start") plt.ylabel("Kambi Payback") plt.title("Payback Over Time") plt.
sns.set()
sns.set(rc={"figure.figsize": (16, 8)})
df_payback_days_to_start.plot(kind="line",legend=False, marker=".")
plt.xlabel("Days for Event Start")
plt.ylabel("Kambi Payback")
plt.title("Payback Over Time")
plt.show()
因此,正如您在下面看到的,我的数据集有几个空值。这就是为什么大多数线不打印的原因,当存在空值时,它不会连接
+---------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+-----+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+
| event_id | 1004179030 | 1004179031 | 1004179032 | 1004179033 | 1004179034 | 1004179035 | 1004179036 | 1004179037 | 1004179041 | 1004179042 | ... | 1004180739 | 1004180740 | 1004180741 | 1004180742 | 1004180743 | 1004180744 | 1004180745 | 1004180746 | 1004180747 | 1004180748 |
+---------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+-----+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+
| days_to_start | | | | | | | | | | | | | | | | | | | | | |
| 0.006250 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 0.004861 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 0.003472 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 0.002778 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 0.002083 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
+---------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+-----+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+
检查您的设置。下面的代码生成正确类型的绘图:
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
sns.set()
sns.set(rc={"figure.figsize": (16, 8)})
df = pd.DataFrame(np.random.random((10,10)))
df.plot(kind="line",legend=False, marker=".")
plt.xlabel("Days for Event Start")
plt.ylabel("Kambi Payback")
plt.title("Payback Over Time")
plt.show()
您看过这个吗?(可能重复)只是查看了一下,不认为修复程序在其中。请花些时间查看。在这种情况下,我无法重现此问题,因此也无法提供太多帮助。您所说的“检查我的设置”是什么意思?如果你注意到在图表的右边有几条线。它不会在整个图表中重现。你知道这样做的逻辑原因吗?解决了问题!谢谢