Friday, 1 November 2024

GPU Accelerated data processing and Machine learning workflows with RAPIDS


Accelerating Data Processing with cuDF -> Pandas-like GPU DataFrames
If you know Pandas, you can switch to cuDF, a RAPIDS library, to process data on GPUs. most Pandas code will run with minimal changes by simply replacing pandas with cudf.
Example:
# CPU-based Pandas code
import pandas as pd
df = pd.read_csv('data.csv')
df['new_col'] = df['col1'] + df['col2']

# GPU-accelerated cuDF code (zero code change besides import)
import cudf
df = cudf.read_csv('data.csv')  # Uses GPU instead of CPU
df['new_col'] = df['col1'] + df['col2']  # Same operations, much faster




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

Udemy Certificate for my beginning into machine learning with Python

#udemy #machinelearning #python



Conversion of text in a pdf file to speech(mp3) file using Python

Some of the things which i have started, and that may be useful to somebody whoever interested in these type of below mentioned idea:

I have an idea about how to convert a text in pdf to speech(mp3) file, that may be helpful to the blind people. And also who are seriously in other works and want to read the pdf file, simply by mentioning their file and can run in a Python script.

The below code can give you an illustration of how i converted the pdf text to mp3 file, Just one thing you can mention, file name(with filepath) you have to mention, no need to worry about installation of any libraries. Just simply copy the code and paste in any .py file and run in your command prompt or pycharm or any IDE for python.

Code:
-------
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)

Some may have a thought about how to listen the audio without video, and also it is not the every individual aspect to listen the audio without seeing the video. Some have a thought about to listen the audio without a video.

The below code can help you in solving your problem.

Run this code using python3 in Your command prompt or any python IDE. Before that install python interpreter in your machine.

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")

-> All the best, and continue for your success

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.