Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Reference guide for translating Python syntax constructs to Scala equivalents. Use when converting Python code to Scala and need mappings for basic syntax elements like variable declarations, control flow, comprehensions, string formatting, and common operators.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
| Python | Scala |
|---|---|
x = 5 | val x = 5 (immutable) or var x = 5 (mutable) |
x: int = 5 | val x: Int = 5 |
x, y = 1, 2 | val (x, y) = (1, 2) |
Prefer val over var unless mutation is required.
| Python | Scala |
|---|---|
int | Int |
float | Double |
str | String |
bool | Boolean |
None | None (of type Option) or null |
list[T] | List[T] or Seq[T] |
dict[K, V] | Map[K, V] |
set[T] | Set[T] |
tuple[A, B] | (A, B) or Tuple2[A, B] |
Optional[T] | Option[T] |
# Python
if x > 0:
result = "positive"
elif x < 0:
result = "negative"
else:
result = "zero"
// Scala - if is an expression
val result = if (x > 0) "positive"
else if (x < 0) "negative"
else "zero"
# Python for loop
for i in range(10):
print(i)
for item in items:
process(item)
for i, item in enumerate(items):
print(f"{i}: {item}")
// Scala equivalents
for (i <- 0 until 10) println(i)
for (item <- items) process(item)
for ((item, i) <- items.zipWithIndex) println(s"$i: $item")
# Python
while condition:
do_something()
// Scala
while (condition) {
doSomething()
}
# Python list comprehension
squares = [x ** 2 for x in range(10)]
evens = [x for x in numbers if x % 2 == 0]
pairs = [(x, y) for x in xs for y in ys]
// Scala for-comprehensions or map/filter
val squares = (0 until 10).map(x => x * x).toList
val evens = numbers.filter(_ % 2 == 0)
val pairs = for { x <- xs; y <- ys } yield (x, y)
# Python
def add(a: int, b: int) -> int:
return a + b
# Lambda
square = lambda x: x ** 2
# Default arguments
def greet(name: str, greeting: str = "Hello") -> str:
return f"{greeting}, {name}!"
// Scala
def add(a: Int, b: Int): Int = a + b
// Lambda
val square: Int => Int = x => x * x
// or shorter: val square = (x: Int) => x * x
// Default arguments
def greet(name: String, greeting: String = "Hello"): String =
s"$greeting, $name!"
| Python | Scala |
|---|---|
f"Hello, {name}!" | s"Hello, $name!" |
f"Value: {x:.2f}" | f"Value: $x%.2f" |
f"{x + y}" | s"${x + y}" |
| Python | Scala |
|---|---|
** (power) | math.pow(x, y) or use scala.math.pow |
// (floor div) | x / y (for Int) or math.floor(x / y) |
% (modulo) | % |
and, or, not | &&, ` |
in | .contains() |
is | eq (reference equality) |
== | == (value equality) |
# Python
try:
result = risky_operation()
except ValueError as e:
handle_error(e)
finally:
cleanup()
// Scala
import scala.util.{Try, Success, Failure}
// Pattern 1: try-catch
try {
val result = riskyOperation()
} catch {
case e: IllegalArgumentException => handleError(e)
} finally {
cleanup()
}
// Pattern 2: Try monad (preferred for functional style)
val result = Try(riskyOperation()) match {
case Success(value) => value
case Failure(e) => handleError(e)
}
# Python
if value is None:
return default
return process(value)
# Or
result = value if value is not None else default
// Scala - use Option
val result = optionValue match {
case Some(v) => process(v)
case None => default
}
// Or more concisely
val result = optionValue.map(process).getOrElse(default)
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching `acopf-math-model.md` and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Redact text from PDF documents for blind review anonymization
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when checking simplified ADA-derived plan-view bathroom accessibility constraints such as turning space, door clear width, toilet centerline, grab bars, and lavatory knee/toe clearance.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Analyze failed GitHub Action jobs for a pull request.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when extracting plan-view architectural geometry from DXF files with semantic CAD layers, especially when outputs must normalize rooms, doors, fixtures, clearances, and grab bars into machine-checkable JSON.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.