我一直在编写一些非常简单的代码,从数据框中的列绘制值。此值存储在名为numbers
的变量中import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import pyplot as plt
from matplotlib import pyplot as plt
import numpy as np
df = pd.read_csv(r'C://Desktop/Plot/output.csv', delimiter=";", encoding='unicode_escape')
data=df[df['description']=='Someone starts']['num_1'].values
numbers= data #storing the values of the column to dev_x
plt.plot(numbers)
我一直在尝试获取存储在数字中的这些值的方差和均值使用df.var('numbers')
似乎不起作用。希望能有所帮助。
I
我猜你有一个数据框df:
这是您要的吗?
import numpy as np
df['numbers'].mean() #will give you the mean
np.std(df['numbers']) #will give you the stdev