Python Forum
Help trying to write a function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help trying to write a function
#4
Don't use the import * construct, it leads to inconsistencies in the current namespace. Use this for example
import math
import sympy as sy
import pylab
 
xo,yo,zo=sy.symbols('xo yo zo', real=True)
xo=sy.log(yo)
 
dyo1=sy.diff(xo, yo)
print ("dxo/dyo="),dyo1
Then you're sure that the log() function from module sympy is used and not the log() function from the numpy module imported in pylab.
Reply


Messages In This Thread
Help trying to write a function - by Rochense - Apr-12-2019, 11:32 AM
RE: Help trying to write a function - by Rochense - Apr-12-2019, 01:18 PM
RE: Help trying to write a function - by Gribouillis - Apr-12-2019, 02:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Better way to write this function SephMon 1 821 Feb-08-2023, 10:05 PM
Last Post: Gribouillis
  write new function or change the old one to work "smartter? korenron 3 1,990 Aug-09-2021, 10:36 AM
Last Post: jamesaarr
  How can I write a function with three parameters? MehmetAliKarabulut 1 2,437 Mar-04-2021, 10:47 PM
Last Post: Larz60+
  How to write a code with İF function? Aycaaxx 1 1,851 Nov-03-2020, 05:46 AM
Last Post: deanhystad
  Print/write to file function tpolim008 4 2,801 Apr-01-2020, 07:59 PM
Last Post: tpolim008
  How to write test cases for a init function by Unit test in python? binhduonggttn 2 3,132 Feb-24-2020, 12:06 PM
Last Post: Larz60+
  write an integer to file using a function xvkxvo 4 3,212 Dec-10-2019, 11:27 PM
Last Post: xvkxvo
  how can I write my function output on CSV file go127a 13 5,551 May-05-2019, 01:55 PM
Last Post: go127a
  Use the write function manonB 2 2,543 Apr-17-2019, 05:55 AM
Last Post: manonB
  'function' object has no attribute 'write' paramiko lateublegende 1 5,412 Feb-12-2019, 09:03 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020