symbols

How to extract symbols from parsed LaTeX equation in Sympy?

How to extract symbols from parsed LaTeX equation in Sympy? Question: I have parsed a LaTeX equation in Sympy, but now I need to extract the variables to symbols so that I can have Sympy solve/rearrange the equation for specific variables. I know I can use equation.free_symbols to see the symbols contained in the equation, …

Total answers: 1

Altair: change point symbol

Altair: change point symbol Question: I use the code below to create this faceted chart: https://vega.github.io/editor/#/gist/a9f238f389418c106b7aacaa10561281/spec.json I would like to use another symbol (a dash in example) instead of the gray points. I found a lot of examples using a field to render a point by value, but I haven’t found how to apply a …

Total answers: 1

How to render math symbols as text in SVG/EPS/PDF images?

How to render math symbols as text in SVG/EPS/PDF images? Question: When creating graphs using, for instance, Python. It is possible to save these figures as vector graphics (SVG, EPS, PDF) and the text is rendered separately. This makes it possible to select or search the text when shown in a pdf file. However, I’ve …

Total answers: 2

insert symbol into the text

insert symbol into the text Question: Python. Need to place the symbol (suppose "@") after every three comas in the text. For example: text = "Reading practice to help you understand simple texts and find specific information in everyday material. Texts include emails, invitations, personal messages, tips, notices and signs. Texts include articles, reports, messages, …

Total answers: 1

Cant print inch and feet symbols in function

Cant print inch and feet symbols in function Question: Define a function print_feet_inch_short(), with parameters num_feet and num_inches, that prints using ‘ and " shorthand. End with a newline. Remember that print() outputs a newline by default. Ex: print_feet_inch_short(5, 8) prints: 5’ 8" My code: def print_feet_inch_short(num_feet, num_inches): return print(num_feet , num_inches ) ”’ Your …

Total answers: 4

os.popen strange codec issue

os.popen strange codec issue Question: So im trying to use os.popen to run cmd comands, but the problem is that most of the comands have cyrillic characters in them that seem to have some issues with os.popen. When i use this code import os stream = os.popen("dir") output = stream.read() print(output) I get output like …

Total answers: 1

Sympy get Symbol name

Sympy get Symbol name Question: I can get the name of an "undefined" symbol: import sympy as sym knodef = sym.Symbol(‘k_{nodef}’) print(type(knodef)) sym.pprint(knodef.name) <class ‘sympy.core.symbol.Symbol’> k_{nodef} But as soon as I define it as an expression, I cannot get the name anymore. kdef = sym.Symbol(‘k_{def}’) kdef = sym.tan(b*x) print(type(kdef)) sym.pprint(kdef.name) # AttributeError: ‘tan’ object has …

Total answers: 2

^=, -= and += symbols in Python

^=, -= and += symbols in Python Question: I am quite experienced with Python, but recently, when I was looking at the solutions for the codility sample tests I encountered the operators -=, +=, ^= and I am unable to figure out what they do. Perhaps could anyone explain the context in which they are …

Total answers: 3

Using Sympy Equations for Plotting

Using Sympy Equations for Plotting Question: What is the best way to create a Sympy equation, do something like take the derivative, and then plot the results of that equation? I have my symbolic equation, but can’t figure out how to make an array of values for plotting. Here’s my code: from sympy import symbols …

Total answers: 2

Inserting a degree symbol into python plot

Inserting a degree symbol into python plot Question: This is a really simple problem but its escaping me. I’m just trying to insert a degree symbol into the titles and legends of my python plot. Code is below. Thanks. from numpy import * import numpy as np import matplotlib.pyplot as plt theta1 = linspace(0,60,610) theta2 …

Total answers: 4