priceData = pd.read_excel(r'...\Downloads\PriceData.xlsx', skiprows=range(1), usecols = 'B:SN', index_col = 0)
priceData = priceData.drop(priceData.index[[0,1]])
priceData.index.names = ['Date']
priceData.index = priceData.index.map(pd.to_datetime)
sortedPrices = priceData.sort_index(ascending=True)
# To adjust all time series data to start from 1990-01-25 to 2018-09-24
for column in sortedPrices.columns:
if np.isnan(sortedPrices[column].iloc[0]):
table = sortedPrices.drop([column],axis=1, inplace=True)
table
我打印了table
,而不是得到价格表(请参阅下面的内容,除了排序后,日期应从最旧到最新),我收到此消息:
NoneType
请让我知道为什么:/
答案 0 :(得分:0)
var ds = new Miso.Dataset({
key: "1wHow46zTuzCA7veIUnq7K2GU5O3VHzuYsuvW2KocWBQ",
worksheet : "1",
importer: Miso.Dataset.Importers.GoogleSpreadsheet,
parser : Miso.Dataset.Parsers.GoogleSpreadsheet
});
ds.fetch({
success : function() {
... do stuff to the data...
},
error : function() {
// error callback
console.log("Error in reading data!");
}
});
将从drop
中删除那些项目,但是该功能就位了。返回值为sortedPrices
,而不是表的副本。您需要输出新的None
值,而不是单独的变量。