Dataframe变量碰到的奇怪问题

用tushare获得数据后,执行一下代码,

df=ts.get_tick_data()

if df !=None:

    xxxxxxxx

将出现“ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().”,很奇怪,

变通方案是用try:进行异常处理,直接跳过df == None的情况,不进行判断

哪位朋友可否指点下?

转载自:https://blog.csdn.net/ccc123_ok/article/details/87521833

You may also like...