```python
import sympy
sympy.init_printing()
from sympy import I,pi,oo
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
```


```python
x = sympy.Symbol("x")
y = sympy.Symbol("y",real=True)
sympy.sqrt(x**3)
```


```python
x = sympy.Symbol("x")
expr = 1+2*x**2+3*x**3
expr
```


```python
expr.args
```


```python
expr.args[1]
```


```python
expr = 2*sympy.cos(x)*sympy.sin(x)
```


```python
expr
```


```python
sympy.simplify(expr)
```


```python
expr = sympy.exp(x) * sympy.exp(y)
```


```python
expr
```


```python
distances = [10,15,17,26,20]
times = [0.3,0.47,0.55,1.20,1.0]

```


```python
speeds = []
for i in range(len(distances)):
    speeds.append(distances[i]/times[i])
    
speeds
```




    [33.333333333333336,
     31.914893617021278,
     30.909090909090907,
     21.666666666666668,
     20.0]




```python
[d/t for d,t in zip(distances,times)]
```




    [33.333333333333336,
     31.914893617021278,
     30.909090909090907,
     21.666666666666668,
     20.0]




```python
product_quatities = [13,5,6,10,11]
prices = [1.2,6.5,1.0,4.8,5.0]
total = sum([q*p for q,p in zip(product_quatities,prices)])
total
```




    157.1




```python
distances = np.array(distances)
times = np.array(times)
product_quatities = np.array(product_quatities)
prices = np.array(prices)
```


```python
A = np.ones(shape=(1,3),dtype=float)
B = np.ones(shape=(3,1),dtype=float)
C = (A*B)
C
```




    array([[1., 1., 1.],
           [1., 1., 1.],
           [1., 1., 1.]])




```python
values = product_quatities*prices
total = values.sum()
print(values)
total
```


```python
two_dim = np.array([[3,5,2,4],[7,6,5,5],[1,6,-1,-1]])
two_dim
```




    array([[ 3,  5,  2,  4],
           [ 7,  6,  5,  5],
           [ 1,  6, -1, -1]])




```python
two_dim[:,1:3]
```




    array([[ 5,  2],
           [ 6,  5],
           [ 6, -1]])




```python
two_dim.flatten()
```




    array([ 3,  5,  2,  4,  7,  6,  5,  5,  1,  6, -1, -1])




```python
def f(t):
    return np.exp(-t) * np.sin(2*np.pi*t)

t1 = np.arange(0.0,5.0,0.1)
t2 = np.arange(0.0,5.0,0.02)
plt.figure()
plt.subplot(2,1,1)
plt.plot(t1,f(t1),'bo')
```


```python
x = np.linspace(start=-5,stop=5,num=150)
fig, ax = plt.subplots(figsize = (7,4))
ax.plot(x,x,label='linear')
ax.plot(x,x**2,label='quadratic')
ax.plot(x,x**3,label='cubic')
ax.plot(x,x**4,label='polynomial')
ax.legend()
```


```python
fig,axes = plt.subplots(nrows=2,ncols=5,figsize=(14,4.5))
for i, ax in enumerate(axes.flatten()):
    ax.set_title("x to the {:d}".format(i+1))
    ax.plot(x,x**(i+1))
    
fig.tight_layout();
```


```python

```


```python

```

f06c421f5c776b423fea76e67e750e19f3275252
ipynb
Jupyter Notebook
SymPy.ipynb
sidhu177/pythonprog
a75285e9e4d3cd6f1257b9a79dc39e49c68a695d
MIT
2019-05-01T04:32:07.000Z
2019-05-04T02:22:16.000Z
SymPy.ipynb
sidhu177/pythonprog
a75285e9e4d3cd6f1257b9a79dc39e49c68a695d
MIT
SymPy.ipynb
sidhu177/pythonprog
a75285e9e4d3cd6f1257b9a79dc39e49c68a695d
MIT
Qwen/Qwen-72B
1. YES
2. YES