我的问题是len(df)
可以是小数点
len(DataFrame)
代码:
import pandas as pd
from sklearn import preprocessing ,model_selection ,svm
from sklearn.linear_model import LinearRegression
df = quandl.get('WIKI/GOOGL',authtoken =
't_nBiw5yVx3CXs3Zsuco')
df = df[['Open','High','Low','Close','Volume']]
HL_pct = (df['High'] - df['Low']) / df['Low'] * 100
PCT_change = (df['Close'] - df['Open']) / df['Open'] * 100
df = ['Volume','HL_pct','PCT_change','Close']
print(len(df))
forcast_col = df['Close']
答案 0 :(得分:0)
如果您引用的是python函数len
,则该函数将返回the number of items in an object。不能为十进制,因为项不能为十进制数字(即int
的一半)。