Understanding Results with Python: 100 Drills for Data Analysis and Statistical Analysis by Kanro Tomoya & Nana Nishiyama & Smith John

Understanding Results with Python: 100 Drills for Data Analysis and Statistical Analysis by Kanro Tomoya & Nana Nishiyama & Smith John

Author:Kanro, Tomoya & Nana, Nishiyama & Smith, John
Language: eng
Format: epub
Published: 2024-08-12T00:00:00+00:00


import numpy as np

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

u = np.linspace(0, 2 * np.pi, 100)

v = np.linspace(0, 2 * np.pi, 100)

u, v = np.meshgrid(u, v)

x = (1 + 0.5 * np.cos(v)) * np.cos(u)

y = (1 + 0.5 * np.cos(v)) * np.sin(u)

z = 0.5 * np.sin(v)

【Diagram Answer】

【Code Answer】

import numpy as np

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

u = np.linspace(0, 2 * np.pi, 100)

v = np.linspace(0, 2 * np.pi, 100)

u, v = np.meshgrid(u, v)

x = (1 + 0.5 * np.cos(v)) * np.cos(u)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.