Cursor — AI-first IDE (fork of VS Code) который интегрирует Claude / GPT-4 прямо в редактор. Для аналитика данных Cursor — главный productivity boost 2026. В этом гайде — 3 практических паттерна работы, реальные кейсы, и production советы.
Setup для аналитика
Установка
- Download
cursor.com(free + Pro $20/мес) - Open existing project folder (e.g., your analysis repo)
- Cmd/Ctrl + L — open AI chat
- Cmd/Ctrl + K — inline edit mode
Recommended configuration
\\\
Settings → Models:
Default: Claude 4.5 Sonnet (best for SQL/Python)
Fallback: GPT-4o
Settings → Editor:
Auto-import: ON
Inline AI suggestions: ON
.cursorrules file в root проекта:
«Use pandas chains, prefer .agg() over apply().
For SQL: ClickHouse dialect.
Code style: PEP-8, snake_case.»
\\\
Паттерн 1: SQL генерация по бизнес-описанию
Use case
Менеджер: «Покажи top-10 продавцов в Москве по выручке за прошлый месяц, отсортируй по среднему чеку.»
Без Cursor
- Открыть BI / sql-editor
- Вспомнить schema (orders / sellers / cities)
- Написать query вручную
- Дебажить syntax errors
- 15-30 минут
С Cursor
- Cmd+L → задаёшь вопрос в natural language
- Cursor читает
schema.sqlв проекте, генерирует query - Inline review, accept/reject
- 2-5 минут
Реальный prompt example
\\\
Контекст: ClickHouse база с таблицами orders (seller_id, city, order_date, revenue, order_id) и sellers (seller_id, name).
Задача: Топ-10 продавцов в Москве по total revenue за май 2026, отсортированных по avg check (revenue / count(distinct order_id)).
Constraints: only sellers с минимум 100 заказов за период.
\\\
Cursor output:
\\\sql
WITH seller_stats AS (
SELECT
o.seller_id,
s.name,
sum(o.revenue) AS total_revenue,
count(distinct o.order_id) AS orders,
sum(o.revenue) / count(distinct o.order_id) AS avg_check
FROM orders o
JOIN sellers s ON o.seller_id = s.seller_id
WHERE o.city = 'Moscow'
AND o.order_date >= '2026-05-01' AND o.order_date < '2026-06-01'
GROUP BY o.seller_id, s.name
HAVING orders >= 100
)
SELECT name, total_revenue, orders, avg_check
FROM seller_stats
ORDER BY avg_check DESC
LIMIT 10;
\\\
Время saved: ~20 минут per query × 5-10 queries в день = 2-3 hours saved daily.
Паттерн 2: pandas refactoring (apply → vectorized)
Use case
Legacy pandas код, slow для production. Cursor рефакторит на vectorized operations.
Пример
Original (slow):
\\\python
def categorize_user(row):
if row['days_since_signup'] < 30:
return 'new'
elif row['days_since_signup'] < 180:
return 'returning'
elif row['days_since_signup'] < 365:
return 'loyal'
else:
return 'veteran'
df['segment'] = df.apply(categorize_user, axis=1) # SLOW on 1M rows
\\\
Cursor prompt
\Refactor this apply() into vectorized pandas using pd.cut() or np.select(). Should be faster on 1M+ rows.\
Cursor output
\\\python
import numpy as np
conditions = [
df['days_since_signup'] < 30,
df['days_since_signup'] < 180,
df['days_since_signup'] < 365,
]
choices = ['new', 'returning', 'loyal']
df['segment'] = np.select(conditions, choices, default='veteran')
\\\
Benchmark на 1M rows:
- Original apply(): 12 seconds
- Vectorized np.select(): 0.04 seconds
- 300x speedup
Другие refactoring tasks Cursor handle:
- Loop → list comprehension
- Multiple groupby → single chain
- Merge → join_asof для time-series
- For loops → pandas .rolling() / .expanding()
Паттерн 3: Jupyter notebook автоматизация
Use case
«Сделай мне notebook с EDA для этого CSV»
Cursor workflow
- Создать пустой
.ipynbfile - Open notebook
- Cmd+K → «Generate EDA notebook for sales.csv»
- Cursor генерирует все cells: imports, data loading, describe(), histograms, correlation heatmap, выводы
Example output
\\\python
# Cell 1: Imports
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
# Cell 2: Load data
df = pd.read_csv('sales.csv', parse_dates=['order_date'])
print(f"Shape: {df.shape}")
print(f"\nColumns: {df.columns.tolist()}")
print(f"\nDtypes:\n{df.dtypes}")
df.head()
# Cell 3: Missing values
missing = df.isnull().sum()
print(f"Missing values per column:\n{missing[missing > 0]}")
# Cell 4: Numerical stats
print(df.describe())
# Cell 5: Categorical analysis
cat_cols = df.select_dtypes(include='object').columns
for col in cat_cols:
print(f"\n{col}:")
print(df[col].value_counts().head())
# Cell 6: Time series trend
daily_sales = df.groupby('order_date')['revenue'].sum()
daily_sales.plot(figsize=(12, 6), title='Daily revenue trend')
plt.show()
# Cell 7: Correlation heatmap
num_cols = df.select_dtypes(include=np.number).columns
sns.heatmap(df[num_cols].corr(), annot=True, cmap='coolwarm')
plt.show()
\\\
Time saved: 1-2 hours per EDA → 10 минут.
Production советы
✅ DO
- .cursorrules file в root проекта (укажи domain-specific conventions)
- Reference конкретные files через @ syntax (\
@schema.sql @utils.py\) - Iterate — first AI output редко perfect, refine с follow-up prompts
- Code review AI output — она не всегда right (especially для complex business logic)
- Privacy — не paste sensitive data в prompts (Cursor sends to API)
❌ DON'T
- Не trust AI без проверки на production data
- Не используй для critical security decisions (auth, payments)
- Не loose context — Cursor не помнит prev sessions автоматически
- Не depend полностью — ML model bugs / hallucinations возможны
Use cases beyond analytics
Аналитик с Cursor может handle:
- dbt models — natural language → dbt SQL
- Airflow DAGs — workflow generation
- Streamlit dashboards — UI generation
- API integrations — boilerplate code
- Documentation — auto-generate from code
- Tests — unit tests boilerplate
- Bug fixing — paste error, get fix
ROI estimate для аналитика
Аналитик spends ~50% time на:
- SQL writing / debugging
- Pandas data wrangling
- Documentation
- Code refactoring
Cursor 2-5x speedup на этих задачах = 30-40% overall productivity boost.
Cost-benefit:
- Cost: $20/мес ($240/год)
- Saved time: 10-20 hours/мес
- Hourly rate Senior analyst: $50-80
- ROI: 50-100x
FAQ
Cursor vs GitHub Copilot?
Cursor больше agentic. Copilot — лучший inline autocomplete. Для аналитики Cursor более полезен (multi-step tasks, codebase understanding).
Cursor vs ChatGPT?
Cursor integrated в IDE с file context. ChatGPT отдельная conversation. Для coding tasks Cursor superior.
Privacy concerns?
Cursor sends snippets to Claude/GPT API. Для confidential code → Privacy mode в Pro plan (no data retention).
Free vs Pro?
Free: 50 slow requests, 200 fast requests/мес. Pro $20: unlimited fast requests + privacy. Worth it для daily users.
Russian language support?
Yes. Можно prompt'ить на русском, AI отвечает на русском. Но code keywords всегда английские.
Что дальше
- 521 SQL-задача — тренироваться писать SQL без AI
- 532 Python-задачи
- YandexGPT/ChatGPT для SQL генерации
- Polars vs Pandas
Источники
- cursor.com — официальная документация
- Anthropic Claude best practices
- Real-world cases from analyst community