by Suf | Mar 20, 2022 | Programming, Rust, Tips
This tutorial will go through how to convert a string to an integer/float and vice versa. Table of contentsNumbers in RustIntegersFloatsRust Convert String to IntegerRust Convert Integer to StringRust Convert String to FloatRust Convert Float to StringRust Convert...
by Suf | Mar 19, 2022 | Programming, Rust, Tips
This tutorial will go through how to split a string in Rust. Table of contentsSplit String in Rust Using split()Split String in Rust Using split_whitespace()Split String in Rust Using lines()Split String in Rust Using RegexSplit String on Multiple Delimiters in...
by Suf | Mar 19, 2022 | Programming, Python, Tips
In Python, we can read and write to files using the with statement with the open() function. The open() function opens a file and returns a file object. The file object exposes a file-oriented API, with methods such as read() or write() to the underlying resource. If...
by Suf | Mar 19, 2022 | Programming, Python, Tips
In Python, you can use the datetime library to work with dates and times. The datetime.strftime() method converts a datetime object containing a date and time to different string formats. You cannot call strftime() on a string object because strftime() is not a method...
by Suf | Mar 18, 2022 | Programming, Python, Tips
In Python, a Pandas Series is a one-dimensional labelled array capable of holding data of any type. Pandas Series is the same as a column in an Excel spreadsheet. If you have string entries in a Series object that you want to split, you cannot use the string method...
by Suf | Mar 18, 2022 | Programming, Python, Tips
In Python, a set is an unordered collection of unique elements. The append() method belongs to the List data type. If you try to call the append() method on a set to add elements to the set, you will raise the AttributeError: ‘set’ object has no attribute...