# CPU-based Pandas codeimport pandas as pddf = pd.read_csv('data.csv')df['new_col'] = df['col1'] + df['col2']
# GPU-accelerated cuDF code (zero code change besides import)import cudfdf = cudf.read_csv('data.csv') # Uses GPU instead of CPUdf['new_col'] = df['col1'] + df['col2'] # Same operations, much faster
SAI BHAGAVAN'S BLOG
Friday, 1 November 2024
GPU Accelerated data processing and Machine learning workflows with RAPIDS
Friday, 19 May 2023
Mojo- A Python based Language taking low level programming to the next level
Mojo, a new Python-based language designed to bridge the gap between high-level and low-level programming.
Mojo aims to provide the best of both worlds by combining the ease of use and readability of Python with the efficiency and control of low-level languages. It achieves this by introducing a set of new features and constructs that allow programmers to write code that is both concise and efficient, without resorting to tedious and error-prone low-level optimizations.
Some of the key features of Mojo include:
Static typing and type inference: Mojo allows programmers to specify and infer the types of variables and expressions at compile-time, which can help catch errors and improve performance.
Memory management and pointers: Mojo provides a safe and efficient memory model that allows programmers to allocate, deallocate, and manipulate memory directly, without the risk of memory leaks or buffer overflows.
Low-level constructs: Mojo introduces several low-level constructs such as inline assembly, raw pointers, and bitwise operations that can help optimize performance-critical code.
Integration with Python: Mojo is designed to interoperate seamlessly with Python, allowing programmers to leverage the rich ecosystem of Python libraries and tools while still writing low-level code.
Mojo is still a young language and is actively being developed by a small but dedicated community. If you're interested in learning more about Mojo or trying it out, check out the official website and documentation. Who knows, you may discover a new favorite language that takes your low-level programming skills to the next level.
Sunday, 28 June 2020
Conversion of text in a pdf file to speech(mp3) file using Python
import os
try:
import PyPDF2
except ImportError:
print("Installing Required modules")
os.system('python -m pip install PyPDF2')
try:
import gtts
except ImportError:
print("Installing Required modules")
os.system('python -m pip install gtts')
import PyPDF2
import gtts
from gtts import gTTS
pdfobj=open('pdf file path','rb')# mention the pdf file in .pdf format
pdfReader = PyPDF2.PdfFileReader(pdfobj)
print(pdfReader.numPages)
text3=''
for t1 in range(1,pdfReader.numPages):
text1=pdfReader.getPage(t1)
text2=text1.extractText()
text3=text3+'\n'+text2
pdfobj.close()
obj=gTTS(text=text3,lang='en',slow=False)
#mention the filename with .mp3 format to save in your local disk
obj.save("mp3file.mp3")
-> Continue coding, All the Best
Conversion of Video file(mp4) to an Audio file(mp3)
import os
try:
import moviepy
except ImportError:
print("Installing required modules")
os.system('python -m pip install moviepy')
print("successfully installed required modules")
import moviepy.editor as mp
try:
# Enter video file path in mp4 format
mp3=mp.VideoFileClip(r"Videofile.mp4")
except FileNotFoundError:
print("Enter the correct Video file path")
finally:
# Enter the audio file to create in mp3 format
mp3.audio.write_audiofile(r"audiofile.mp3")
print("Video file successfully converted to Audio file")
Saturday, 27 June 2020
Information about the source code management tool GIT and GITHUB repository comands
Important Information about the GIT Repository useful commands in real-time, which can be helpful for our Source code management process. Feel it will be useful like cheat sheets about GIT and GITHUB repository.