错误意味着它的内容:
AttributeError: 'str' object has no attribute 'DataFrame' ^ ^ ^ the kind of error | | the thing you tried to use what was missing from it
它抱怨的线:
df = pd.DataFrame(date, columns = ['Date']) ^ ^ | the attribute the error said was missing the thing the error said was a string
在我上面添加几行代码之前,一直没有问题
显然,在"上面几行代码"中的某个地方,你导致pd
了一个字符串.当然,当我们查看这几行代码时,我们会发现:
pd = PDays[j] ^ ^ | the string that you're making it into the thing that you're making a string