p3txt=np.loadtxt("data_.txt")
` 是长文本文件的示例以及它们在列中的方式。我问如何在将这些列分配给python的一行变量时如何读取文件并将这些列分开?每当我尝试将.txt转换为float类型
时,我都会收到错误public class IdDetails
{
public string transactionDate { get; set; }
public string upnName { get; set; }
public string movementTrade { get; set; }
public string baseCurve { get; set; }
public string cTolerance { get; set; }
//17 more declarations below
}
是我现在正在阅读的文件
答案 0 :(得分:1)
尝试:
skiprows=1 -> skip the first row (because it doesn't contain numbers)
.T -> take transpose. numpy is [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order) meaning that when splitting up the data it will first cut up the columns and leave the rows as whole
a, b -> assigning to a tuple of variables triggers the splitting up of the right-hand-side
说明:
FilterRegistrationBean