-
use
withto open fileswith open(path_to_file, 'r') as rfile: ...
-
use list comprehension when possible
-
use dict comprehension when possible
-
use generators
f = next((x for x in xs if predicate), None)
-
private methods should start with
_class A: def _add(self, a): ...
- don't use
import numpy as nporimport pandas as pd, etc.from numpy import linspace, mean from pandas import Dataframe