External Cheatsheets:
Numpy
-
Numpy Array to list
-
Initializing a matrix
-
Boolean array or matrix
-
np.newaxis1
-
string array with numpy2
Pandas
-
Data import
data = pd.read_csv(os.path.join(root_folder, filename), sep=‘\t’, skiprows=1, header=None, names=[‘col1’,‘col2’])
to reset indexes (and drop it)
data.reset_index(drop=True, inplace=True)
```
-
Iteration3
-
Nested dictionary to dataframe (from_dict)
-
Adding (extra) named indexes (rows) and sorting column based on named indexes
Scipy
Interpolation
- https://docs.scipy.org/doc/scipy/tutorial/interpolate/smoothing_splines.html
- https://numpy.org/devdocs/reference/generated/numpy.interp.html#numpy.interp