bz2.decompress(s) in Python Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report With the help of bz2.decompress(s) method, we can decompress the compressed bytes of string into original string by using bz2.decompress(s) method. Syntax : bz2.decompress(string) Return : Return decompressed string. Example #1 : In this example we can see that by using bz2.decompress(s) method, we are able to decompress the compressed string in the byte format of string by using this method. Python3 1=1 # import bz2 and decompress import bz2 s = b'This is GFG author, and final year student.' s = bz2.compress(s) # using bz2.decompress(s) method t = bz2.decompress(s) print(t) Output : b'This is GFG author, and final year student.' Example #2 : Python3 1=1 # import bz2 and compress import bz2 s = b'GeeksForGeeks@12345678' s = bz2.compress(s) # using bz2.decompress(s) method t = bz2.decompress(s) print(t) Output : b'GeeksForGeeks@12345678' Comment More infoAdvertise with us Next Article bz2.decompress(s) in Python J Jitender_1998 Follow Improve Article Tags : Python Python-bz2 Practice Tags : python Similar Reads bz2.compress(s) in Python With the help of bz2.compress(s) method, we can get compress the bytes of string by using bz2.compress(s) method. Syntax : bz2.compress(string) Return : Return compressed string. Example #1 : In this example we can see that by using bz2.compress(s) method, we are able to compress the string in the b 1 min read zlib.decompress(s) in Python With the help of zlib.decompress(s) method, we can decompress the compressed bytes of string into original string by using zlib.decompress(s) method. Syntax : zlib.decompress(string) Return : Return decompressed string. Example #1 : In this example we can see that by using zlib.decompress(s) method, 1 min read gzip.decompress(s) in Python With the help of gzip.decompress(s) method, we can decompress the compressed bytes of string into original string by using gzip.decompress(s) method. Syntax : gzip.decompress(string) Return : Return decompressed string. Example #1 : In this example we can see that by using gzip.decompress(s) method, 1 min read gzip.compress(s) in Python With the help of gzip.compress(s) method, we can get compress the bytes of string by using gzip.compress(s) method. Syntax : gzip.compress(string) Return : Return compressed string. Example #1 : In this example we can see that by using gzip.compress(s) method, we are able to compress the string in t 1 min read zlib.compress(s) in python With the help of zlib.compress(s) method, we can get compress the bytes of string by using zlib.compress(s) method. Syntax : zlib.compress(string) Return : Return compressed string. Example #1 : In this example we can see that by using zlib.compress(s) method, we are able to compress the string in t 1 min read numpy.compress() in Python The numpy.compress() function returns selected slices of an array along mentioned axis, that satisfies an axis. Syntax: numpy.compress(condition, array, axis = None, out = None) Parameters : condition : [array_like]Condition on the basis of which user extract elements. Applying condition on input_ar 2 min read base64.decodebytes(s) in Python With the help of base64.decodebytes(s) method, we can decode the binary string with the help of base64 data into normal form. Syntax : base64.decodebytes(b_string) Return : Return the decoded string. Example #1 : In this example we can see that by using base64.decodebytes(s) method, we are able to g 1 min read base64.decodestring(s) in Python With the help of base64.decodestring(s) method, we can decode the binary string with the help of base64 data into normal form. Syntax : base64.decodestring(b_string) Return : Return the decoded string. Example #1 : In this example we can see that by using base64.decodestring(s) method, we are able t 1 min read base64.b32decode() in Python With the help of base64.b32decode() method, we can decode the binary string using base32 alphabets into normal form. Syntax : base64.b32decode(b_string) Return : Return the decoded string. Example #1 : In this example we can see that by using base64.b32decode() method, we are able to get the decoded 1 min read base64.encodebytes(s) in Python With the help of base64.encodebytes(s) method, we can encode the string using base64 encoded data into the binary form. Syntax : base64.encodebytes(string) Return : Return the encoded string. Example #1 : In this example we can see that by using base64.encodebytes(s) method, we are able to get the e 1 min read Like