Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Extracting coefficients from symbolic expressions

Assume a list of symbolic expressions (x0, x1,... are symbolic variables) like

[0, -15*x1^3/x0^7 + 10*x1*x2/x0^6 - x3/x0^5, 15*x1^2/x0^6 - 4*x2/x0^5, -6*x1/x0^5, x0^(-4)]

I want to extract the integer coefficients and get as result

[[0], [-15, 10, -1], [15, -4], [-6], [1]]

What is the most efficient/elegant method to accomplish this?