KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
190 stars 49 forks source link

Cannot read csv file with pyq #91

Closed unix9999 closed 5 years ago

unix9999 commented 5 years ago

Questions

Steps to reproduce the issue

q("table1: ("SSFFFIFFI"; enlist ",") 0:`data_fin.csv")

Expected result

Read the table successfully

Actual result

q("table1: ("SSFFFIFFI"; enlist ",") 0:`data_fin.csv")
                         ^
SyntaxError: invalid syntax

(The data can be read in q successfully: q)table1: ("SSFFFIFFI"; enlist ",") 0:`data_fin.csv)

abalkin commented 5 years ago

When you have double quotes inside a q query, you need to use single quotes to surround it:

q('table1: ("SSFFFIFFI"; enlist ",") 0:`data_fin.csv')