by Suf | Mar 25, 2022 | Machine Learning, Programming, Python, Tips
In TensorFlow 2.0, tf.Session is no longer in use. TensorFlow 2.0 encapsulates graph computations as Python functions instead of using Session making TensorFlow more Pythonic. If you want to continue using Session in TensorFlow 2.0, use tf.compat.v1.Session() instead....
by Suf | Mar 25, 2022 | Machine Learning, Programming, Python, Tips
In TensorFlow 2.0, tf.ConfigProto is no longer in use. The functionalities of ConfigProto are now under tf.config.experimental. If you want to continue using ConfigProto in TensorFlow 2.0 use tf.compat.v1.ConfigProto() instead. You can follow the migration guide if...
by Suf | Mar 24, 2022 | Programming, Python, Tips
In Python 2.x, the ‘u’ in front of string values indicates that the string is a Unicode string. In Python 3, all strings are Unicode by default, and therefore you will not see the ‘u’ in front of a Unicode string. This tutorial will go through...
by Suf | Mar 23, 2022 | Programming, Python, Tips
The method apply() is a pandas method that applies a function along an axis of a DataFrame. The apply() method does not belong to the List data type. If you try to call the apply() method on a list, you will raise the AttributeError: ‘list’ object has no...
by Suf | Mar 23, 2022 | Programming, Python, Tips
If you try to remove an element from a list that does not appear in that list, you will raise the ValueError: list.remove(x) x not in list. To solve this error, you can check for list membership using the in operator, for example, if x in a_list. This tutorial will go...
by Suf | Mar 20, 2022 | Programming, Rust, Tips
This tutorial will go through how to read and write to a file for Rust version 1.26+ and Rust version 1.0. Table of contentsRead a File to String in Rust 1.26+Read a File to String in Rust 1.0Read a File to Vec<u8> in Rust 1.26+Read a File to Vec<u8> in Rust...