Here's a summary of how to automatically check if Google Colaboratory supports pep8.
Do this first
!pip install pycodestyle flake8 pycodestyle_magic
%load_ext pycodestyle_magic
Add this to the beginning of the cell you want to check and execute
%%flake8
Example
%%flake8
result=DataFrame.from_dict(correlations,orient='index')
result.columns=['PCC','p-value']
print(result.sort_values('PCC'))
result
2:7: E225 missing whitespace around operator
2:40: E231 missing whitespace after ','
3:15: E225 missing whitespace around operator
3:22: E231 missing whitespace after ','
The number on the left indicates the line and the number of characters that do not correspond to pep8.
It takes time to copy %% flake8 to all cells. .. .. Please let me know if there is a way to insert into all cells at once.
Recommended Posts