Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
first time in python
#2
By algebra substitution you are wanting to plot the function
sin(x)-(5+sin(x)**2)**2 + sin(1-log(5+sin(x)**2)). Correct?

My opinion, YMMV, is to use matplotlib and I find it easiest with Pandas
BTW - around here you will find that folks want you to start, try doing things, and then post a question about how far you got and what needs to be fixed. What I am posting here should cause you to think and give you leads about what to look at next - docs for Pandas and docs for matplotlib, for example. That plus a few youtube videos and you should be on your way.

import pandas as pd
import matplotlib.pyplot as plt
import math

def fn_generator(x) :
    return math.sin(x)-(5+math.sin(x)**2)**2 + math.sin(1-math.log(5+math.sin(x)**2))
    
data = []
for x in range(1,10000):
    data.append([x,fn_generator(x/100)])

df = pd.DataFrame(data)
df.columns = ['count','amount']

df.plot(kind="line", x='count', y='amount')
Reply


Messages In This Thread
first time in python - by TDW5 - Nov-01-2019, 01:44 PM
RE: first time in python - by jefsummers - Nov-01-2019, 06:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to change UTC time to local time in Python DataFrame? SamKnight 2 1,660 Jul-28-2022, 08:23 AM
Last Post: Pedroski55
  Getting error in finding time.time() value in python Lakshana 1 2,520 Jan-11-2018, 07:07 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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