FinGPT icon indicating copy to clipboard operation
FinGPT copied to clipboard

If using all scalar values, you must pass an index

Open frank0828 opened this issue 1 year ago • 6 comments

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.

frank0828 avatar Jun 20 '23 12:06 frank0828

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?

oliverwang15 avatar Jun 20 '23 13:06 oliverwang15

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文件里并没有下载加入任何新的信息。

frank0828 avatar Jun 20 '23 14:06 frank0828

I am also

amwork2020 avatar Jun 24 '23 09:06 amwork2020

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 avatar Jun 25 '23 08:06 xiaozhao1795

@xiaozhao1795 改动是不报错了,但是生成的文件列数是91个,原来是85个,同时post_publish_time时间列也变串行了

amwork2020 avatar Jun 25 '23 11:06 amwork2020

@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 串行没啥关系

xiaozhao1795 avatar Jun 25 '23 13:06 xiaozhao1795