Mukul Latiyan

Mukul Latiyan

363 Articles Published

Articles by Mukul Latiyan

Page 6 of 37

How to convert CSV File to PDF File using Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 5K+ Views

In today's data-driven world, being able to convert CSV files to more presentable PDF format is a common requirement. Python provides powerful libraries that make this conversion process straightforward and efficient. This tutorial demonstrates how to convert CSV files to PDF using Python by first converting the CSV to HTML format using pandas, then converting the HTML to PDF using pdfkit. Required Libraries and Setup Before starting, you'll need to install the required libraries and the wkhtmltopdf utility ? pip install pandas pdfkit You also need to install wkhtmltopdf from: https://wkhtmltopdf.org/downloads.html Sample ...

Read More

How to convert CSV columns to text in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 9K+ Views

CSV (Comma Separated Values) files are commonly used to store and exchange tabular data. However, there may be situations where you need to convert the data in CSV columns to text format, for example, to use it as input for natural language processing tasks or data analysis. Python provides several tools and libraries that can help with this task. In this tutorial, we will explore different methods for converting CSV columns to text in Python using the Pandas library. Approach Load the CSV file into a pandas DataFrame using the read_csv() function. Extract the desired column ...

Read More

How to convert categorical data to binary data in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 4K+ Views

Categorical data, also known as nominal data, is a type of data that is divided into discrete categories or groups. These categories have no inherent order or numerical value, and they are usually represented by words, labels, or symbols. Categorical data is commonly used to describe characteristics or attributes of objects, people, or events, and it can be found in various fields such as social sciences, marketing, and medical research. In Python, categorical data can be represented using various data structures, such as lists, tuples, dictionaries, and arrays. The most commonly used data structure for categorical data in Python ...

Read More

How to convert a NumPy array to a dictionary in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 9K+ Views

Converting a NumPy array to a dictionary in Python is useful when you need dictionary operations like key-based lookups or when working with APIs that require dictionary inputs. This tutorial demonstrates multiple approaches to perform this conversion. Understanding NumPy Arrays A NumPy array is a table of elements (typically numbers) of the same data type, indexed by a tuple of positive integers. The ndarray class provides efficient storage and operations for multi-dimensional data. Method 1: Converting Individual Elements to Dictionary This approach flattens the array and creates a dictionary where keys are indices and values are ...

Read More

How to add a new entry to the PATH variable in ZSH on Mac OS in Linux

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 14K+ Views

The PATH variable in ZSH determines where the shell looks for executable commands. By default, macOS Catalina and later versions don't include a .zshrc file, so we need to create one to customize our shell environment. This file contains configuration settings and environment variables that are loaded every time a new ZSH session starts. Creating the .zshrc File To create the .zshrc file, follow these steps − Open Terminal Type touch ~/.zshrc to create the file Press Return You can open and edit the .zshrc file from any directory using − vi ...

Read More

Best practices when running Node.js with port 80 (Ubuntu) in Linux

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 778 Views

Running Node.js applications on port 80 is a common requirement for web servers, but it presents security challenges on Linux systems. Port 80 is a privileged port that requires root access to bind to, creating potential security vulnerabilities when applications run with elevated privileges. The Root Privilege Problem Most Linux distributions require root privileges to bind to ports below 1024, including port 80. The naive approach is to run the application with superuser privileges: sudo node server.js While this solves the immediate problem, it creates significant security risks. If an attacker compromises your Node.js ...

Read More

Convert XLSX to CSV in Linux with Command Line in Linux

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 2K+ Views

XLSX files are the standard format for modern Microsoft Excel spreadsheets, containing structured data organized in rows and columns. CSV (Comma-Separated Values) files are plain text files where data records are separated by commas, making them more portable and easier to process programmatically. Converting XLSX to CSV in Linux can be accomplished using several command-line tools. This guide covers the two most effective methods: ssconvert from Gnumeric and libreoffice headless mode. Method 1: Using Gnumeric ssconvert The Gnumeric spreadsheet application includes a powerful command-line utility called ssconvert that handles various spreadsheet format conversions. Installation First, ...

Read More

Crontab day of the week syntax on Linux

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 6K+ Views

A crontab is a configuration file that contains a list of commands scheduled to run at specific times. It uses the cron daemon, a time-based job scheduler in Unix-like operating systems, to execute these commands automatically. Understanding Crontab Syntax To create or edit a crontab job, use the following command: crontab -e This opens the crontab editor where you can add scheduled jobs. Each crontab entry follows a specific format with five time fields followed by the command to execute: * * * * * command_to_execute Crontab Time Fields ...

Read More

Fastest way to tell if two files have the same contents in Unix/Linux

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 784 Views

Let's say that we have two files inside a directory called dir1, and at first both these files are different. Different in the sense that the text they contain isn't the same. The files in the folder − immukul@192 dir1 % ls -ltr total 16 -rw-r--r-- 1 immukul staff 7 Jul 7 10:37 2.txt -rw-r--r-- 1 immukul staff 8 Jul 8 19:05 3.txt The contents inside the first file (2.txt) looks something like this − immukul@192 dir1 % cat 2.txt orange The contents inside the second file (3.txt) looks something like ...

Read More

Linux – How to find the files existing in one directory but not in the other directory?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 950 Views

Let's consider a case where we have two directories, say d1 and d2, and both these directories contain some files, which may be the same or different. Now we want to list out the names of those files that are present in one of these directories (say d1) and not present in the other directory (say d2). In order to do that we must be familiar with either the diff command or the comm command, as both these commands can be used to solve the above problem. Using the diff Command Let's first explore the diff command, ...

Read More
Showing 51–60 of 363 articles
« Prev 1 4 5 6 7 8 37 Next »
Advertisements