MCPcopy Create free account
hub / github.com/Datakitpage/Datakit / formatDataFrame

Function formatDataFrame

frontend/src/lib/python/executor.ts:267–285  ·  view source on GitHub ↗
(dfInfoStr: string)

Source from the content-addressed store, hash-verified

265 * Format DataFrame for display
266 */
267export function formatDataFrame(dfInfoStr: string): {
268 shape: [number, number];
269 columns: string[];
270 dtypes: Record<string, string>;
271 preview: any[][];
272 memory_usage?: number;
273} {
274 try {
275 return JSON.parse(dfInfoStr);
276 } catch (error) {
277 console.error('[Python] Failed to parse DataFrame info:', error);
278 return {
279 shape: [0, 0],
280 columns: [],
281 dtypes: {},
282 preview: [],
283 };
284 }
285}
286
287/**
288 * Check if code contains plotting commands

Callers 1

renderOutputFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected