mit einem Klick
python-data-analysis
// Best practices for multi-step Python tasks including data analysis, HuggingFace datasets, token counting, and any task requiring state across multiple python() calls.
// Best practices for multi-step Python tasks including data analysis, HuggingFace datasets, token counting, and any task requiring state across multiple python() calls.
Keyboard shortcuts for common desktop applications — LibreOffice, GIMP, Chrome, Thunderbird, VS Code.
When to prefer GUI mouse clicks over keyboard shortcuts — especially for formatting, multi-step visual tasks, and cross-application workflows.
General GUI navigation patterns for desktop environments — finding elements, interacting with menus, and handling dialogs.
How to interpret accessibility tree elements and correlate them with screenshot regions for accurate GUI interaction.
Verification patterns to confirm task completion before submitting. Read this before calling submit().
Workarounds for bot detection, CAPTCHA, 403 errors, and Cloudflare challenges when browsing the web.
| name | python-data-analysis |
| description | Best practices for multi-step Python tasks including data analysis, HuggingFace datasets, token counting, and any task requiring state across multiple python() calls. |
Variables, imports, data from previous calls DO NOT EXIST. This is the #1 source of NameError.
DEFAULT STRATEGY: Write a complete .py script to a file, then run it.
with open('/app/solve.py', 'w') as f:
f.write('''#!/usr/bin/env python3
import numpy as np
# ALL logic in one file
data = np.load("/app/data.npy")
result = process(data)
with open("/app/answer.txt","w") as out:
out.write(str(result))
''')
Then: bash("python3 /app/solve.py && cat /app/answer.txt")
import json, numpy as np
# Save: json.dump(obj, open('/tmp/state.json','w'))
# Save: np.save('/tmp/arr.npy', array)
# Load: obj = json.load(open('/tmp/state.json'))
from datasets import load_dataset
from transformers import AutoTokenizer
ds = load_dataset("org/name", split="train")
tok = AutoTokenizer.from_pretrained("model-name")
total = sum(len(tok.encode(r["text"])) for r in ds if r["domain"] == "science")
with open("/app/answer.txt","w") as f: f.write(str(total))
# Each block: imports + load + process + print
import pandas as pd
df = pd.read_csv('f.csv')
print(df.describe())