导入CSV文件作为pandas DataFrame
将CSV文件读入pandas DataFrame的Python方法是什么(然后可以将其用于统计操作,可以具有不同类型的列等)? 我的CSV文件"value.txt"具有以下内容: Date,"price","factor_1","factor_2" 2012-06-11,1600.20,1.255,1.548 2012-06-12,1610.02,1.258,1.554 2012-06-13,1618.07,1.249,1.552 2012-06-14,1624.40,1.253,1.556 2012-06-15,1626.15,1.258,1.552 2012-06-16,1626.15,1.263,1.558 2012-06-17,1626.15,1.264,1.572 在R中,我们将使用以下命令读取此文件: price <- read.csv("value.txt") 这将返回R data.frame: > price <- read.csv("value.txt") > price Date price factor_1 factor_2 1 2012-06-11 1600.20 1.255 1.548 2 2012-06-12 1610.02 1.258 1.554 3 2012-06-13 1618.07 1.249 1.552 4 2012-06-14 1624.40 1.253 1.556 5 2012-06-15 1626.15 …