megan_mcp
Forum Replies Created
-
Hi @masmail
I believe this error is due to the way you structured your .Q.dpft function.
If you take a look at the screenshot provided you will see that this namespace only accepts 4 arguments;
- d is a directory handle
- p is a partition of a database
- f is a field of the table named by t below
- t the name (as a symbol) of a simple table whose columns are vectors or compound lists
The first two parameters are correct [f1DbPath;2020.01.02, ..] however you need to take a look at the order of your second two.
Let me know if this helps!
Thanks,
Megan
-
-
Hi @kal8na
Can you make sure your variable names match up with those that are given in the expected schema?
Thanks,
Megan
-
Hi @kal8na
Since you have adjusted your code to use ‘ * ‘ to read in your columns as strings, you no longed need the following cast statement:
messages: update trade_id: `$string trade_id from messages
As this is changes the format of the column from image_1 to image_2.
Let me know if this helps!
Thanks,
Megan
-
Hi @kal8na
Let me break down question 4.7 for you:
- Using your timeSeries dictionary that you created in ex 4.6, compare the correlation of edge against the correlation of qty then the correlation of edge against the correlation of numTrds. To do this you can use the keyword cor – cor – corelation coefficient | Reference | kdb+ and q documentation – Kdb+ and q documentation (kx.com)
- Store this data in a dictionary called edgeCor with the keys being edge, qty and numTrds and the values being their correlation with the edge series.
There are a few different ways this can be done but using iteration is included as a suggestion.
Let me know if you require further assistance.
Thanks,
Megan
code.kx.com
cor – corelation coefficient | Reference | kdb+ and q documentation - Kdb+ and q documentation
cor is a q keyword that calculates the correlation coefficient of two numeric lists.
-
Hi @kal8na
I believe the problem is within your badTrades variable you do not provide the classifyTrades function with a parameter.
To fix this, simply pass in the tradeContext table into the function:
badTrades: select from classifyTrades[tradeContext] where exQuality = 0b;
Let me know if this works!
Thanks,
Megan
-
Hi @kal8na
So the question is asking for more than just joining the two tables.
– It’s looking for the last date
– It’s looking you to add two extra columns bid and ask which contain information from the nbbo table
Here is an example from the documentation to help (screenshot below).
If you have any further questions please let me know!
Thanks,
Megan
-
megan_mcp
AdministratorApril 10, 2024 at 10:43 am in reply to: Advanced Capstone 3.6 test fail error "sensor".I don’t believe your answer for exercise 3.1 requires a get, set.
However try this:
hdbH:hopen 5099 hdbH"\\l f1" hdbH"tables[]"
Let me know if this works!
Thanks,
Megan
-
I’ve took a look at your ‘.f1.createLapTable’ function and I’ve made a few adjustments:
.f1.createLapTable:{[eventInput;sensorInput]
uniqueSensor: distinct select sensorId from sensorInput;
rack:(select from eventInput) cross uniqueSensor;
w:(rack[`time];rack[`endTime]);
f:wj[w;`date`sensorId`time;select from rack;(select from sensorInput;(avg;`sensorValue))];
delete date from f
}
- To retrieve a column from a table you must use bracket notation with a backtick as follows – w:(rack[`time];rack[`endTime]); *Example provided below*
- It states in the .f1.createLapTable function template that it wants a table returned with the following columns: `session`lapId`time`endTime`sensorId`sensorValue. Hence why the delete statement for date was included at the end.
If you have any questions please let me know!
Thanks,
Megan
-
Hi @Kal8na
I believe the error lies in how you imported your messages.csv. It states in the question that “The exch_message column should be read in as a string”.
To do this in q we use the ( * ) character. So to adjust your import, change “SJF” to “**”.
Let me know if this works!
Thanks,
Megan
-
Hi @Htip18
Due to technical issues with our coding format, it makes it hard to understand.
Would you be able to send me your code as just text?
Thanks,
Megan
-
Hi @Kal8na
This update statement seems correct, can you send me a screenshot of the error you’re receiving ?
Thanks,
Megan
-
Hi @Kal8na
I’ve simplified your function and it seems to work fine. I replaced table: tables[] with just tables[].
If you have any further questions please let me know.
showTableSummary:{tables[]!{count value x} each tables[]}
Many thanks,
Megan
-
Hi @Jake
There are two options you can use to load in your messages.csv file:
1. Use the Table Importer that’s located under Tools -> Table Importer (Screenshot provided)
2. Load the data from the csv into a kdb+/q table using this example from the ‘Working with Files’ section of the KDB Developer Level 2 course (Screenshot provided)
Hope this helps!
Megan
-
megan_mcp
AdministratorMarch 26, 2024 at 10:17 am in reply to: Fundamentals Capstone 5.2 length errorHi @Kenan
The problem lies with your last bit of code ‘edge > avgEdgePerOption[avgEdge]’.
You are only able to index into a dictionary, not a table. So as avgEdgePerOption returns as a table, when you run ‘avgEdgePerOption[avgEdge]’ it returns nothing (screenshot below).This is what causes the length error as edge is a list and avgEdgePerOption[`avgEdge] is an empty dictionary.
Hope this helps!
Thanks,
Megan🙂