Data viewing made easy with PyCharm's SciView

We already encountered the SciView panel in PyCharm briefly in the previous chapter. In this section, we will fully explore the support for data-related tasks offered by this feature. By the end of this section, I hope you will be able to appreciate the SciView panel, which I personally consider to be PyCharm's best feature when it comes to scientific computing and data science projects.

The code example we will be working with in this section is included in the Chapter12/SciViewPanel folder of our code repository and looks as follows. In essence, this program is the same as the one we were working with in the previous chapter.

However, instead of simply plotting the histogram to indicate the distribution of the x and y variables once, here, we will randomly generate x and y five times using the range function and draw the corresponding histogram at each iteration of the for loop, as we will see immediately after this section:

import numpy as np
import matplotlib.pyplot as plt


N = 100
for _ in range(5):
x = np.random.normal(0, 1, N)
y = np.random.normal(2, 3, N)

plt.hist(x, alpha=0.5, label='x')
plt.hist(y, alpha=0.5, label='y')
plt.legend(loc='upper right')
plt.show()
Note that, as per Python's best practices, we are assigning the iterator to _ in our for loop since we don't need that value anywhere.

We will be using this program to examine various features in the next section, starting with a more in-depth look at the Plots tab of the SciView panel.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.120.109