如何使用熊猫保存此文件?

时间:2019-05-22 14:47:15

标签: python-3.x pandas

这是错误消息 提高

  

ValueError('未正确调用DataFrame构造函数!')

text = tweet.text #code to get my rawdata/tweets from twitter 
df = pd.DataFrame(text) 
df = ['created_at','tweet'] 
df.to_csv('tes1.csv')
df.head()

1 个答案:

答案 0 :(得分:0)

数据框构造函数将不接收字符串。将其转换为字典

if ($school -eq 'KCC) {
    $HomeDirectory = "\\ad.esw.org.uk\KCC\StaffUsers\$SamAccountName"

    If ($Department -eq 'IT Staff'){
      $MiddleOU = 'OU=IT Services,OU=Business Managment,OU=Staff,OU=Users,OU='
    }
    ElseIf ($Department -eq 'ILS Staff'){
      $MiddleOU = 'OU=Resources,OU=Business Managment,OU=Staff,OU=Users,OU='
    }
    ElseIf ($Department -eq 'DATA Staff'){
      $MiddleOU = 'OU=Data,OU=Business Managment,OU=Staff,OU=Users,OU='
    }
    ElseIf ($Department -eq 'Facilities Staff'){
      $MiddleOU = 'OU=Estates & Facilities,OU=Business Managment,OU=Staff,OU=Users,OU='
    }
    ElseIf ($Department -eq 'Catering Staff'){
      $MiddleOU = 'OU=Events & Catering,OU=Business Managment,OU=Staff,OU=Users,OU='
    }
    Else {
      $MiddleOU = 'OU=Staff,OU=Users,OU='
    }
}