FinGPT
FinGPT copied to clipboard
If using all scalar values, you must pass an index
Hi, when I run download_contents.py for my csv fill, I encountered this issue,' If using all scalar values, you must pass an index.' What should I do to fix this?
Thanks.
Hi, frank. I'm sorry but I can't judge your problem just through a single error. Would you please show me the specific codes that went wrong or show me the full callbacks of your error?
Hi, frank. I'm sorry but I can't judge your problem just through a single error. Would you please show me the specific codes that went wrong or show me the full callbacks of your error?
您好,我是在为 FinGPT v1准备资料的时候,我首先运行download_titles.py Collecting 300339 Geting pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Get total 37 pages. All Done!
获得了股票的csv,然后在运行download_contents.py时,
300339.csv If using all scalar values, you must pass an index All Done!
出现了这个错误,现在csv文件里并没有下载加入任何新的信息。
I am also
Hi, frank. I'm sorry but I can't judge your problem just through a single error. Would you please show me the specific codes that went wrong or show me the full callbacks of your error?
您好,我是在为 FinGPT v1准备资料的时候,我首先运行download_titles.py Collecting 300339 Geting pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Get total 37 pages. All Done!
获得了股票的csv,然后在运行download_contents.py时,
300339.csv If using all scalar values, you must pass an index All Done!
出现了这个错误,现在csv文件里并没有下载加入任何新的信息。
修改下get_one_content()函数方法中的 res = pd.Series(res).to_frame().T 改成 res = pd.Series(res).to_frame().T.reset_index(drop=True); 同时修改get_content()函数中的df[new_columns] = df.apply(lambda x:get_one_content(x), axis = 1, result_type= "expand", )改成 df[new_columns] = df.apply(lambda x:get_one_content(x).squeeze(), axis = 1, result_type= "expand", ) 就可以了,可以试试
@xiaozhao1795 改动是不报错了,但是生成的文件列数是91个,原来是85个,同时post_publish_time时间列也变串行了
@xiaozhao1795 改动是不报错了,但是生成的文件列数是91个,原来是85个,同时post_publish_time时间列也变串行了
df= df.apply(lambda x:get_one_content(x).squeeze(), axis=1, result_type= "expand", ) 不指定new_columns 就可以了,post_publish_time 串行没啥关系