Using the CSV plugin

To see the CSV plugin in action, let's consider a sample CSV file:

  1. In the data folder of our current project code folder, open the sample.csv file in PyCharm's editor (alternatively, you can also use any other CSV file that you'd like). The sample.csv file contains the following sample data:
a,b,c
1,2,3
4,5,6
  1. With the file open in the editor, you will see that the preceding raw data is displayed by default in Text mode. However, if we were to switch to Table Editor mode (using the navigation bar at the bottom of the editor, as highlighted in the following screenshot), we would be taken to the graphical display of the table data:

The table editor in PyCharm
  1. As you can see, the CSV data being displayed in the formatted table will allow data scientists to inspect their data better.
  1. Furthermore, you can edit the content of the considered CSV file by clicking on the individual cells of the displayed table and directly changing their values. This method of altering the data in a CSV file is considerably better than doing so via a text editor, where it could be quite difficult to identify which column a specific data point belongs to.
  1. The toolbar at the top of this Table Editor also allows for various navigation and display options. For example, the Header row fixed checkbox specifies whether the first row should be used as the header of the table, while adjusting the number in the Text-lines per row prompt will change how compact or loose the rows appear.
  2. Finally, it is also possible to work with files in other delimiter-separated formats such as tab-separated values (TSV) in the same manner. However, most data files are formatted to CSV in data science projects, so chances are, you will only need to worry about CSV files.
Note that one potential downside to using the CSV plugin is that it is unable to parse extremely large files (for obvious reasons). Most of the time, the plugin can handle tens of thousands of CSV rows, so most scientific computing/data science projects will have no problem taking advantage of the CSV plugin.

The Table Editor is also the last feature we will consider in this chapter regarding PyCharm's Scientific Mode. In general, by combining and using the features we have discussed simultaneously in a scientific computing/data science project, we gain the dynamic ability to view and work with both the code and the data within the project.

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

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