Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
2108 views
Kernel: Python 3 (Anaconda)
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline plt.rcParams["figure.figsize"] = (12, 9) # inches import seaborn as sns; sns.set()
data = pd.read_csv('forestfires.csv', header=0, sep=',')
data.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 517 entries, 0 to 516 Data columns (total 13 columns): X 517 non-null int64 Y 517 non-null int64 month 517 non-null object day 517 non-null object FFMC 517 non-null float64 DMC 517 non-null float64 DC 517 non-null float64 ISI 517 non-null float64 temp 517 non-null float64 RH 517 non-null int64 wind 517 non-null float64 rain 517 non-null float64 area 517 non-null float64 dtypes: float64(8), int64(3), object(2) memory usage: 52.6+ KB
data.head()
sns.distplot(data['area']);
/ext/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg. warnings.warn("The 'normed' kwarg is deprecated, and has been "
Image in a Jupyter notebook
data['area'].value_counts(normalize=True)
0.00 0.477756 1.94 0.005803 3.71 0.003868 0.90 0.003868 1.95 0.003868 2.14 0.003868 2.18 0.003868 1.56 0.003868 9.96 0.003868 28.66 0.003868 1.46 0.003868 0.68 0.003868 0.43 0.003868 1.64 0.003868 6.43 0.003868 9.27 0.003868 0.52 0.003868 1.75 0.003868 11.06 0.003868 1.63 0.003868 17.20 0.001934 48.55 0.001934 0.95 0.001934 0.77 0.001934 11.19 0.001934 15.64 0.001934 2.64 0.001934 3.52 0.001934 38.48 0.001934 5.39 0.001934 ... 1.61 0.001934 1.07 0.001934 6.38 0.001934 5.86 0.001934 3.19 0.001934 11.16 0.001934 8.85 0.001934 86.45 0.001934 5.18 0.001934 30.18 0.001934 2.01 0.001934 1.01 0.001934 20.03 0.001934 0.79 0.001934 49.59 0.001934 4.41 0.001934 7.02 0.001934 0.71 0.001934 9.41 0.001934 0.09 0.001934 3.32 0.001934 11.53 0.001934 5.55 0.001934 3.20 0.001934 4.88 0.001934 1.26 0.001934 2.44 0.001934 2.03 0.001934 2.21 0.001934 24.24 0.001934 Name: area, Length: 251, dtype: float64
fig, ax = plt.subplots(1, 3) sns.violinplot(data['area'], ax=ax[0]) sns.violinplot(np.log(1+data['area']), ax=ax[1]) sns.violinplot(np.log(1+np.log(1+data['area'])), ax=ax[2]);
Image in a Jupyter notebook
sns.distplot(np.log(1+data['area']));
/ext/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg. warnings.warn("The 'normed' kwarg is deprecated, and has been "
Image in a Jupyter notebook
sns.distplot(np.log(1+np.log(1+data['area'])));
/ext/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg. warnings.warn("The 'normed' kwarg is deprecated, and has been "
Image in a Jupyter notebook