Python-bloggers

Python Troubleshooting Q&A

This article was first published on SH Fintech Modeling , and kindly contributed to python-bloggers. (You can report issue about the content on this page here)
Want to share your content on python-bloggers? click here.

This is just a small collection of common error messages and solutions that we encounter when using Python.

Python Troubleshooting Q&A

1. Pyfolio – AttributeError: ‘numpy.int64’ object has no attribute ‘to_pydatetime’

2. For using git, add git path to the PATH on Windows

3. TabError: inconsistent use of tabs and spaces in indentation

4. Multiple prints in Jupyter notebook

# InteractiveShell.ast_node_interactivity 
# : ‘all’ | ‘last’ | ‘last_expr’ | ‘none’ 
# (default : ‘last_expr’)
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = “all”

5. ValueError: Please initialize `Bidirectional` layer with a `tf.keras.layers.Layer` instance.

Just delete tensorflow.

#from tensorflow.keras.layers import Bidirectional, Dropout, Activation, Dense, LSTM
#from tensorflow.python.keras.layers import CuDNNLSTM
#from tensorflow.keras.models import Sequential

from keras.layers import Bidirectional, Dropout, Activation, Dense, LSTM
from keras.layers import CuDNNLSTM
from keras.models import Sequential

to be added….

To leave a comment for the author, please follow the link and comment on their blog: SH Fintech Modeling .

Want to share your content on python-bloggers? click here.
Exit mobile version