In [1]:

```
import pandas as pd
```

In [2]:

```
dfsleep = pd.read_csv("https://vincentarelbundock.github.io/Rdatasets/csv/datasets/sleep.csv")
dfsleep
```

Out[2]:

In [3]:

```
import seaborn as sns
```

In [4]:

```
dfiris = pd.read_csv("https://raw.githubusercontent.com/ianmcloughlin/datasets/master/iris.csv")
dfiris
```

Out[4]:

In [5]:

```
sns.pairplot(dfiris, hue="class");
```

In [6]:

```
sns.displot(dfiris["petal_width"], kde=True);
```

In [7]:

```
sns.displot(dfiris[dfiris["class"] == "setosa"]["petal_width"], kde=True);
```

In [8]:

```
dfauto = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data")
dfauto
```

Out[8]:

Use Google to fix it!

Have a look at the following blog post.

Can you replicate the analysis using Python?

**Reformulation of parameters of the logistic function appliedto power curves of wind turbines**

*Daniel Villanueva and Andrés E. Feijóo; Electric Power Systems Research; Vol. 137; Pages 51-58; 2016*

The current procedure for obtaining the parameters of the logistic function, used as a model for the power curve of wind turbines, provides meaningless values. These values are different for each wind turbine and obtaining them requires an optimization process. This paper proposes a procedure to obtain the parameters of the 4-parameter logistic function based on the features of the power curve, providing a model that is a function of the power curve parameters supplied by the manufacturer. Furthermore, that model can be used to derive another 4-parameter model and a 3-parameter model is proposed for certain conditions. The three models consist of a continuous function which simplifies the implementation of the curve in a computer program compared to piecewise models. In addition, the probability density function of the output power of a wind turbine is derived by using each model.

$$ P(u) = a \frac{1 + me^{-u/t}}{1+ ne^{-u/t}} $$

In [9]:

```
import numpy as np
a, m, n, t = 2011.1, 2.6650, 622.922, 1.4090
u = np.linspace(0.0, 30.0, 1000)
P_u = a * (1.0 + m * np.exp(-u / t)) / (1.0 + n * np.exp(-u / t))
```

In [10]:

```
import pandas as pd
df = pd.DataFrame({"wind": u, "power":P_u})
df
```

Out[10]:

In [11]:

```
import seaborn as sns
sns.scatterplot(data=df, x="wind", y="power");
```