【发布时间】:2020-07-29 03:44:16
【问题描述】:
输入 config_note.csv:
Default,case 1,case 2,Time: \nJoin Connection: \nUser Remark:
然后我只通过以下命令提取最后一列:
col_list = ["project", "name 1", "name 2", "note"]
df = pd.read_csv("config_note.csv", usecols=col_list, engine='python',error_bad_lines=False)
print('df["note"]:', str(df["note"].iloc[0]))
但输出仍然为:
Time: \nJoin Connection: \nUser Remark:
我试过直接输入变量,得到我想要的:
test = "Time: \nJoin Connection: \nUser Remark:"
print(test)
这就是我想要的:
Time:
Join Connection:
User Remark:
谁能帮我解决 csv 的输入问题?
【问题讨论】:
-
你想通过打印字符串来达到什么目的?