본문으로 건너뛰기
cccskills
무료GitHub에 공개

datagrok-calc-column

Add a calculated, formula-based column to a dataframe via the datagrok_exec tool. Use whenever the user asks to compute, derive, add, or create a new column from existing columns — LipE, ratios, log/round, heavy atom count, any expression in the Datagrok formula DSL. Replaces hand-written addNewFloat/addNewInt + for-loop with a single formula-attached column that recomputes when source columns change.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

datagrok-calc-column

Use t.columns.addNewCalculated(name, formula, type?) in datagrok_exec code to add a formula-driven column. The formula stays attached to the column, so edits to source columns trigger automatic recompute.

Do not use t.columns.addNewFloat('LipE') plus a manual for loop — that produces a static column with no formula and no recompute.

Signature

await t.columns.addNewCalculated(
  name,              // string
  formula,           // string — DSL, see below
  type?,             // 'auto' (default) | 'double' | 'int' | 'string' | 'bool' | 'datetime'
  treatAsString?,    // boolean — wraps formula in quotes
): Promise<DG.Column>

t is the current DG.DataFrame (injected by datagrok_exec). If you have a DataFrame from elsewhere, replace t with that variable.

Formula DSL — quick reference

FormMeaning
${ColumnName}per-row scalar reference, exact case
$[ColumnName]whole-column reference (use inside aggregates)
rowcurrent row index
+ - * / ^operators
Round, RoundFloat, Log, Log10, Sqrt, Absmath functions
Avg($[col]), Sum($[col]), Min($[col]), Max($[col]), StDev($[col])aggregates over a whole column
Max([${A}, ${B}]), Min([${A}, ${B}])per-row max / min across columns — the argument is an array
Chem:getInchis(${molecule})only functions tagged vectorFunc: 'true' work here — see Which functions work in a formula
"text"string literal (double quotes)

Both operator and function forms parse: ${pIC50} - ${cLogP} ≡ Sub(${pIC50}, ${cLogP}).

Full function catalog: help/transform/add-new-column.md.

Examples

// Lipophilic efficiency
await t.columns.addNewCalculated('LipE', '${pIC50} - ${cLogP}');
// Log of activity
await t.columns.addNewCalculated('logIC50', 'Log10(${IC50})');
// Per-row maximum of two columns — note the array argument.
await t.columns.addNewCalculated('CS max', 'Max([${Chemical Space X}, ${Chemical Space Y}])');

Which functions work in a formula

A package function (Chem:foo, Admetica:bar, ...) can be used inside an addNewCalculated formula only if it is tagged vectorFunc: 'true' in its metadata. Everything else must be called imperatively via grok.functions.call(...) in a separate datagrok_exec call.

Chem properties → use the chem catalog, not a formula

For molecular properties (MW, LogP, LogS, HBA, HBD, PSA, rotatable bonds, stereo centers, molecule charge): use Chem:addChemPropertiesColumns (boolean flags) or Chem:getProperties(molecules, selected?) (string list) — see datagrok-chem-toolkit. Example:

await grok.functions.call('Chem:addChemPropertiesColumns', {
  table: t, molecules: t.col('smiles'), MW: true,
});

What this skill does NOT do

  • It does not filter, sort, or select rows — those are separate skills.
  • It does not add viewers — use grok.shell.addViewer(...) or a future viewer skill.
  • It does not run server-side scripts — use grok.functions.call(...) or the script's registered name.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Add support for a new curve data format in the Curves package converter system

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Create info panels that appear in the context panel based on semantic types

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Add a new single-objective optimization algorithm to the sci-comp library. Use when the user asks to implement a new optimizer (e.g. gradient descent, BFGS, simulated annealing, differential evolution).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Add unit tests to a Datagrok package

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Answer a "how do I …" question about the platform with a Gherkin scenario on @datagrok-libraries/bdd that is filmed into a how-to video (grok-bdd guide), so the answer is demonstrated, sent as a video plus numbered steps, and kept as a regression test; the same scenarios, filmed in help mode, are the GIFs of the help pages

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Translate hand-written Playwright specs (or any existing UI tests) into Gherkin features on @datagrok-libraries/bdd, then prove the features test what they claim by backward-matching them against the originals with independent reviewers, and fix the gaps in the core, the library and the features

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

datagrok-ai의 스킬 모두 보기

이 스킬의 문제 신고