Ceci est une ancienne révision du document !
Read following important documentation about:
Save your scripts in a folder inside the data folder, calling the script folder 'my_scripts' or whaterver. If 'my-scripts' is set as your current working directory, then the data files are available under this address '../[data file]', for instantce: '../geyser1.TAB'
FB: this script works fine ! Do not delete it !
import pandas as pd import matplotlib.pyplot as plt gys1 = pd.DataFrame(pd.read_csv('../geyser1.TAB', '\t')) g_int = gys1['Interval'] ax = plt.gca() ax.hist(g_int, bins=20, color='r') ax.set_xlabel('Intereruption time') ax.set_ylabel('Frequency') ax.set_title('Histogram') plt.show()
import matplotlib.pyplot as plt import pandas as pd gysr1_boxplot = pd.read_csv('...\geyser1.TAB', '\t') data_gysr1 = gysr1_boxplot['Interval'] plt.boxplot(data_gysr1) ax = plt.gca() ax.set_xlabel('222 cases') ax.set_ylabel('Interruption time ( minutes') ax.set_title('Box and Whisker Plot') plt.show()
AB: Put face- and edgecolor to change both of them. You can also have to different color for the in- and outside of each point.
import matplotlib.pyplot as plt import pandas as pd geysr1_scatterplot = pd.read_csv('...\geyser1.TAB', '\t') geysr1_data_Xax = geysr1_scatterplot['Duration'] geysr1_data_Yax = geysr1_scatterplot['Interval'] plt.scatter(geysr1_data_Xax, geysr1_data_Yax, facecolor='y', edgecolor='y') ax = plt.gca() ax.set_xlabel('Eruption duration time (minutes)') ax.set_ylabel('Interuption time (minutes)') ax.set_title('Scatter Plot of INTERVAL vs DURATION') plt.show()