1. Pandas Pandas is a software library written for the python programming language for data manipulation and analysis. Pandas is well suited for many different kinds of data:
Tabular data with heterogeneously-types columns.
Ordered and unordered time series data.
Arbitrary matrix data with row and column labels.
Any other form of observational / statistical data sets.
The data actually need not be labeled at all to be placed into a pandas data structure.
2. NumPy Numpy is the core library for scientific computing in Python. It provides a high-performance multidimensional array object, and tools for working with these arrays.
3. Matplotlib
Matplotlib is a Python package used for 2D graphics.
Bar graph
Histograms
Scatter Plot
Pie Plot
Hexagonal Bin Plot
Area Plot
4. Selenium
The selenium package is used to automate web browser interaction from Python.
5. OpenCV
OpenCV- Python is a library of Python designed to solve computer vision problems.
6. SciPy
Scipy is a free and open-source Python library used for scientific computing and technical computing.
7. Scikit-Learn
Scikit-learn (formerly scikits.learn) is a free software machine learning library for the Python programming language. It features various classification, regression and clustering algorithms.
8. PySpark
The Spark Python API (PySpark) exposes the Spark programming model to Python.
9. Django
Diango is a Python web framework. A framework provides a structure and common methods to make the life of a web application developer much easier for building flexible, scalable and maintainable web applications
Django is a high-level and has a MVC-MVT styled architecture.
Django web framework is written on quick and powerful Python language.
Django has a open-source collection of libraries for building a fully functioning web application.
10. Tensor Flow
TensorFlow is a Python library used to implement deep networks. In TensorFlow, computation is approached as a dataflow graph.
import fitz # PyMuPDF
def pdf_to_png(pdf_file, output_folder, dpi=300):
# Open the PDF file
pdf_document = fitz.open(pdf_file)
for page_number in range(pdf_document.page_count):
# Get the page
page = pdf_document[page_number]
# Set the resolution (DPI)
zoom = dpi / 72.0
mat = fitz.Matrix(zoom, zoom)
image = page.get_pixmap(matrix=mat)
# Save the image as a PNG file
image.save(f"{output_folder}/page_{page_number + 1}.png", "png")
# Close the PDF file
pdf_document.close()
if __name__ == "__main__":
input_pdf = "input.pdf" # Replace with your PDF file path
output_folder = "output_images" # Replace with your output folder
dpi = 600 # Adjust DPI as needed
pdf_to_png(input_pdf, output_folder, dpi)
#sudoku puzzle create using python chatGPT
import random
def generate_solved_sudoku():
base = 3
side = base*base
# pattern for a baseline valid solution
def pattern(r,c): return (base*(r%base)+r//base+c)%side
# randomize rows, columns and numbers (of valid base pattern)
def shuffle(s): return random.sample(s,len(s))
rBase = range(base)
rows = [ g*base + r for g in shuffle(rBase) for r in shuffle(rBase) ]
cols = [ g*base + c for g in shuffle(rBase) for c in shuffle(rBase) ]
nums = shuffle(range(1,base*base+1))
# produce board using randomized baseline pattern
board = [ [nums[pattern(r,c)] for c in cols] for r in rows ]
return board
def print_sudoku(board):
for i in range(9):
if i % 3 == 0 and i != 0:
print("- - - - - - - - - - - -")
for j in range(9):
if j % 3 == 0 and j != 0:
print("|", end=" ")
print(board[i][j], end=" ")
print()
def remove_numbers(board, difficulty_level):
"""
Remove numbers from the solved Sudoku grid based on the difficulty level.
"""
if difficulty_level == 'easy':
num_to_remove = 30 # Easy: 30 numbers removed
elif difficulty_level == 'medium':
num_to_remove = 40 # Medium: 40 numbers removed
else:
num_to_remove = 50 # Hard: 50 numbers removed
for _ in range(num_to_remove):
row = random.randint(0, 8)
col = random.randint(0, 8)
if board[row][col] != 0:
board[row][col] = 0
# Generate a solved Sudoku puzzle
solved_sudoku = generate_solved_sudoku()
# Print the solved Sudoku puzzle
print("Solved Sudoku Puzzle:")
print_sudoku(solved_sudoku)
# Create a copy of the solved puzzle
unsolved_sudoku = [row[:] for row in solved_sudoku]
# Remove numbers to create a puzzle
difficulty_level = 'medium' # Change difficulty level as needed ('easy', 'medium', 'hard')
remove_numbers(unsolved_sudoku, difficulty_level)
# Print the unsolved Sudoku puzzle (the generated puzzle)
print("\nUnsolved Sudoku Puzzle:")
print_sudoku(unsolved_sudoku)