## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• 07:03
ks147 synchronize #21322
• 06:46
sidhu1012 review_requested #20830
• 06:37
sidhu1012 synchronize #20830
• 06:33
sidhu1012 synchronize #20830
• 06:32
sidhu1012 synchronize #20830
• 06:29
sympy-bot commented #20830
• 06:29
sidhu1012 synchronize #20830
• 06:05
shandanjay starred sympy/sympy
• 05:51
sidhu1012 closed #20054
• 05:49
ks147 commented #21322
• 05:03
rajpratyush commented #12841
• 05:00
rajpratyush commented #14030
• 04:55
rajpratyush commented #13683
• 04:46
sylee957 closed #21305
• 04:46
sylee957 commented #21305
• Apr 14 21:12
smichr synchronize #21323
• Apr 14 21:07
smichr synchronize #21323
• Apr 14 20:57
smichr synchronize #21323
• Apr 14 20:22
sympy-bot commented #21016
• Apr 14 20:22
oscarbenjamin synchronize #21016
Aaron Meurer
@asmeurer
The main function is the series method. The actual code for it is on the various functions, mostly in sympy/functions. There is also sympy/series/formal.py for formal power series, which is for getting the general formula of a series rather than just the first few terms.
Ganesh C K M
@ckmganesh
@asmeurer I checked in all the scripts you suggested. I can't seem to find it. It's not exactly the Taylor series but it is based on that. I also checked the documentation for the same but I couldn't find anything. Could you please help me with it
Sayandip Halder
@sayandip18
Can someone confirm whether solve([abs(x) - 2, arg(x) - pi], x) is returning [(-2,)] on the master? It's showing NotImplementedError: solving Abs(x) when the argument is not real or imaginary. for me although it was returning the correct answer just a while back.
Aaron Meurer
@asmeurer
You can use git checkout to try older commits to find one that works, and use git bisect to find a commit that made the change.
Aaron Meurer
@asmeurer
Although based on the error message, you may have had x set as real=True before. It works if you do that.
Sidharth Mundhra
@0sidharth

the correct answer just a while back

I checked a few commits in the history till October, and it is returning NotImplementedError for me in all of them. I think, as mentioned above, x probably was set to real=True when you tried.

bdonnahue
@bdonnahue
hey folks. I am trying to solve an equation with nested expressions for example: y - f(x +2). I dont understand how to write f so that it can handle the expression x + 2
Sayandip Halder
@sayandip18
@bdonnahue
>>> f=Function('f')
>>> f(x)
f(x)
>>> f(x+2)
f(x + 2)
Christoph Heindl
@cheind
hey everyone! anyone in here that is working with sympy.units?
HighMans
@HighMans
Quick question, how do you either multiply a matrix with the eigenspace from the output of eigenvects or how do you convert a list of matrices in to one matrix?
almighty123789
@almighty123789
Hello Everyone, I am new to python dev and wanted to know how to use debug sympy code. I found on the docs to make SYMPY_DEBUG=True and then use debug_decorator(func). But I just get<function debug_decorator.<locals>.decorated at 0x0000017824EC1430>
Shivam Sundram
@RATED-R-SUNDRAM
hi everyone I am shivam sudram , 2nd year undergraduate at IIT Mandi , i would like to contribute to this org. Any guidance related to where to begin my cotributions and work flow would be very helpful
Anurag-Chevendra
@Anurag-Chevendra
Heyy, I'm Anurag Chevendra, a sophomore at VJTI Mumbai. I really liked this org and would love to start contributing. Can anyone help me out so as from where to start? Thank you.
ayushi-get
@ayushi-get
Hey I am Ayushi Rawat , 2nd year undergraduate and would really love to start my open source journey with this community.
Thank you
Suryam Arnav Kalra
@suryam35
Hi @RATED-R-SUNDRAM @Anurag-Chevendra @ayushi-get , you can start with https://github.com/sympy/sympy/wiki/Introduction-to-contributing for starters, and then you can refer to the docs https://docs.sympy.org/latest/index.html. For the later part, refer to https://github.com/sympy/sympy/wiki/Development-workflow.
Aaron Stiff
@AaronStiff
What does expr.p do?
Naveen Sai
@naveensaigit
@AaronStiff It gives the numerator, but it is only available for Rational as far as I know.
>>> a=Rational(1, 3)
>>> a.p
1
>>> a.q
3
Vaibhav Bhat
@VBhat97
Hey! Are there any steps mentioned anywhere about setting up sympy live locally?
Sidharth Mundhra
@0sidharth
Hey, I believe sympy/sympy#12791 can be closed
zabuja
@zabuja
Hey guys, my name is Atanu Ghosh. I am currently a fresher at TMSL Kolkata. I had never contributed before but would surely like to contribute to this organisation and be part of this great open source community. Please guide me. ThankYou.
kirk86
@kirk86

Would it make sense in the following scenario:

X = sympy.symbols('x', real=True, positive=True)
stats.E(X)
x

stats.E(*) to output Integral of X dP for some probability space Ω,Σ,P instead of just x?

10 replies
Anurag-Chevendra
@Anurag-Chevendra
@suryam35 heyy, thank you! on it.
JP
@JP1128
I'm having problem with processing latex string into latex image using the preview function cause I can't get to install the latex program in Heroku. Does anyone know how to fix this problem?
Constantin Mateescu

Greetings! A while ago I played around with the LaTeX grammar (https://github.com/sympy/sympy/blob/master/sympy/parsing/latex/LaTeX.g4) and added support for complex conjugates to my dev version of sympy. The modification was really simple and only involved adding \overline to the grammar file, regenerating the classes via antlr along with some other small changes to _parse_latex_antlr.py.

Having the ability to compute arbitrary expressions with complex conjugates is really great for the application I'm building. For example, the return value of parse_expr(str(parse_latex('\overline{3 + 4I}'))) would be 3 - 4*I, as expected.

That being said, I was thinking about submitting a PR with this change, but wanted to check with the maintainers of sympy whether this feature makes sense or not. @asmeurer: What do you think?

oponkork
@oponkork

hi all,

say I have a horrible expression of the form X + sqrt(Y + iZ) where X, Y, Z are some expressions. Can I give sympy this form and ask it to collect X,Y,Z in new variables. Something like

A,B,C = some_collect_function((a**2+b**2)+sqrt((a*b*c)+i(a*d)) should set A = a**2+b**2, B = a*b*c and C=a*d.

Aaron Meurer
@asmeurer
@costica1234_twitter yes I think it would be useful. Any improvement to the LaTeX parser is good as long as it is a fairly standard way of representing something
I'm hoping we can move to Lark, which will make these kinds of improvements much easier to make. But the PR for it has stalled sympy/sympy#19825
AbhishekS78
@AbhishekS78_gitlab
Hello all,
I'm Abhishek Sontakke, a second-year UG student at IIT Bombay.
I sent a personal introduction mail on the Sympy mailing list yesterday, but it still hasn't been posted.
Can anyone please moderate it, so it can be posted?
Or should I send it one more time?
Sidharth Mundhra
@0sidharth

I am working on reviving an Old PR, and I am facing an issue - _eval_nseries in Function is returning an undesirable form. Specifically, when _eval_nseries calls _eval_aseries(L697 in function.py), adding a print statement says the asymptotic series being returned is
-(_x - _x**3/2 + 3*_x**5/4 + O(_x**6))*exp(-1/_x**2)/sqrt(pi) + 1
which is what I am expecting, but on returning this expressions changes to
1 + O(x**(-6), (x, oo))
I think the answer sympy is finally returning is wrongly simplified and the original expression is better. This conversion is happening in _eval_nseries of Expr (L3027 in expr.py), where collect(s1, x) outputs the original expression but collect(s1, x) + o is outputting the changed expression.

If anyone can help in getting sympy to output the original expression, it would be greatly appreciated. If this is indeed an undesirable simplification, is it a bug?

Master Grey
@mastergrey
@AbhishekS78_gitlab Sure i'll do that.
Sayandip Halder
@sayandip18
How do I profile sympy code?
basic-programmer-python
@basic-programmer-python
hey Everyone!
I am A Athithya Ithaya (u can simply call me Adi)
I have sent a introduction mail as well as request for guidance for GSOC in mailing list yesterday so I request to post it ...! @AbhishekS78_gitlab
oponkork
@oponkork

hi all,

say I have a horrible expression of the form X + sqrt(Y + iZ) where X, Y, Z are some expressions. Can I give sympy this form and ask it to collect X,Y,Z in new variables. Something like

A,B,C = some_collect_function((a**2+b**2)+sqrt((a*b*c)+i(a*d)) should set A = a**2+b**2, B = a*b*c and C=a*d.

Anything on this?

Constantin Mateescu

@costica1234_twitter yes I think it would be useful. Any improvement to the LaTeX parser is good as long as it is a fairly standard way of representing something

I've just created the PR with support for \overline here: sympy/sympy#20900.

Jim Dupont
@jmikedupont2_gitlab
Howdy
Looking for a mathml xml parser in python, i found sympy has output, any parses?
Benoit Martin
@metabsd
Hi, I'm new with Sympy. Can someone assist me to sympy this. Thx!
Constantin Mateescu
Welcome to Sympy, @metabsd! Here's a code snippet that you can use:
>>> from sympy.abc import x, y
>>> e = (49 * x**2 - 42 * x * y + 9 * y**2) * (7 * x + 3 * y) / (7 * x - 3 * y)
>>> e.subs({x: 1, y: 2})
13
Constantin Mateescu
Here's something else that you can do:
>>> from sympy.parsing.sympy_parser import (parse_expr, standard_transformations, implicit_multiplication_application, convert_xor)
>>>
>>> def parse_plain_text(e, local_dict=None):
...     return parse_expr(
...         e,
...         local_dict=local_dict,
...         transformations=(standard_transformations + (implicit_multiplication_application, convert_xor)),
...         evaluate=False)
...
>>> e = parse_plain_text("(49x^2 - 42xy + 9y^2) (7x + 3y) / (7x - 3y)")
>>> e
(7*x + 3*y)*(49*x**2 - 42*x*y + 9*y**2)/(7*x - 3*y)
>>> e.subs({x: 1, y: 2})
13
Benoit Martin
@metabsd
Benoit Martin
@metabsd
What happen when I use solve(e) ? The result == [{x: -3*y/7}]
This is the normal solving .
Constantin Mateescu
I'm not sure if you can end up with the intermediate form you highlighted as e.subs({x: -3 * y / 7}) will simply return 0.
Neel Gorasiya
@Neel2904
how to set up development environment for sympy in local machine??
Ayush Bisht
@ayushbisht2001
hello everyone, My name is Ayush Bisht and I would like to join this amazing community . Can please , anyone help me, from where to start first so that I get well acquainted with the software and can contribute here.
Ayush Bisht
@ayushbisht2001
can we do some changes to Sympy live shell also ?
Aaron Stiff
@AaronStiff
What is the standard syntax for subscripted variables? x1 or x_1. Either seems to work in most cases, but only underscored subscripts seem to work in all cases (#19005)
Aaron Meurer
@asmeurer
@oponkork your best bet is to substitute the expressions for dummy variables with subs, call collect, then substitute back