Vikram Chiluka

Vikram Chiluka

216 Articles Published

Articles by Vikram Chiluka

Page 18 of 22

How to Convert CSV to Excel using Pandas in Python?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 19K+ Views

In this article, we will show you how to convert a CSV file (Comma Separated Values) to an Excel file using the pandas module in Python. This is useful when you need to transform data into Excel format for reporting or sharing purposes. We'll use a sample CSV file called ExampleCsvFile.csv containing cricket player data to demonstrate the conversion process. Sample Data Our example CSV file contains the following player statistics ? Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 ...

Read More

How to Find Line Number of a Given Word in text file using Python?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 4K+ Views

In this article, we will show you how to find the line number where a specific word appears in a text file using Python. This is useful for searching keywords in documents, logs, or code files. Let's assume we have a text file named TextFile.txt with the following content ? Good Morning TutorialsPoint This is TutorialsPoint sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome TutorialsPoint Learn with a joy Algorithm Following are the steps to find line numbers containing a specific word ? Open the ...

Read More

How to Write a List Content to a File using Python?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 4K+ Views

In this article, we will show you how to write list data to a text file using Python. There are several methods to accomplish this task, each with different formatting options. Writing List Elements Line by Line The most common approach is to write each list element on a separate line using a loop ? # Input list input_list = ['This', 'is', 'a', 'TutorialsPoint', 'sample', 'file'] # Write list elements to file (one per line) with open("ListDataFile.txt", 'w') as filedata: for item in input_list: ...

Read More

How to Remove Newline Characters from a text File?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 5K+ Views

When working with text files in Python, you often encounter newline characters () at the end of each line. This article demonstrates how to remove these newline characters using Python's built-in methods. Let's assume we have a text file called TextFile.txt with the following content: Good Morning TutorialsPoint This is TutorialsPoint sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome TutorialsPoint Learn with a joy Approach 1: Using rstrip() with List Comprehension The most common approach combines readlines() with rstrip() and list comprehension ? # Create a ...

Read More

How to Find the Shortest Words in a Text File using Python?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 3K+ Views

In this article, we will show you how to find and print all the shortest words from a given text file using Python. The shortest words are those having the same length as the minimum length word in the file. We'll work with a sample text file containing various words of different lengths and extract all words that match the shortest length. Sample Text File Let's assume we have a text file called TextFile.txt with the following content ? Good Morning Tutorials Point This is the Tutorials Point sample File Consisting of Specific abbreviated source ...

Read More

How to Perform Numpy Broadcasting using Python using dynamic arrays?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 417 Views

Broadcasting refers to how NumPy handles arrays of different dimensions during arithmetic operations. The smaller array is "broadcast" across the larger array to ensure compatible shapes for element-wise operations. This vectorizes operations in C rather than Python, making calculations faster and more memory-efficient. Broadcasting eliminates the need for data copies while enabling efficient algorithm implementations. However, it can sometimes lead to memory overhead if not used carefully. Broadcasting Rules NumPy follows specific rules when broadcasting arrays ? Arrays are aligned from the rightmost dimension Dimensions of size 1 can be stretched to match larger dimensions ...

Read More

How to create Correlation Matrix in Python by traversing through each line?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 4K+ Views

A correlation matrix is a table containing correlation coefficients between multiple variables. Each cell represents the correlation between two variables, with values ranging from -1 to 1. It's essential for data analysis, helping identify relationships between variables and selecting significant features for machine learning models. Correlation values have specific meanings: Positive values (0 to 1) − Strong positive correlation Negative values (-1 to 0) − Strong negative correlation Zero (0) − No linear relationship between variables Benefits of Correlation Matrix The correlation matrix provides several advantages: Identifies relationships between independent variables Helps select significant ...

Read More

How to Delete Specific Line from a Text File in Python?

Vikram Chiluka
Vikram Chiluka
Updated on 26-Mar-2026 25K+ Views

In this article, we will show you how to delete a specific line from a text file using Python. We'll explore different methods to accomplish this task with practical examples. Assume we have a text file named TextFile.txt with the following content ? Good Morning This is Tutorials Point sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome everyone Learn with a joy Method 1: Using readlines() and write() This approach reads all lines into memory, filters out the unwanted line, and rewrites the file ? ...

Read More

How do you get the current figure number in Python's Matplotlib?

Vikram Chiluka
Vikram Chiluka
Updated on 25-Mar-2026 3K+ Views

In this article, we will learn how to get the current figure number in Python's Matplotlib. This is useful when working with multiple figures and you need to identify which figure is currently active. Matplotlib is a comprehensive plotting library for Python that provides MATLAB-like functionality. When working with multiple plots, each figure gets assigned a unique number that you can retrieve programmatically. Using plt.gcf().number What is plt.gcf()? The matplotlib.pyplot.gcf() function returns the current figure object. If no figure exists, it creates a new one automatically. matplotlib.pyplot.gcf() Example Here's how to ...

Read More

How to install NumPy for Python 3.3.5 on Mac OSX 10.9?

Vikram Chiluka
Vikram Chiluka
Updated on 25-Mar-2026 1K+ Views

This article shows you how to install NumPy in Python on macOS using three different methods. NumPy is a powerful Python library for numerical computing, providing support for large multi-dimensional arrays and mathematical functions. Using pip (recommended) Using Anaconda Using Homebrew What is NumPy NumPy is a fundamental package for scientific computing in Python. It provides a powerful N-dimensional array object, sophisticated array manipulation functions, and tools for integrating C/C++ and Fortran code. NumPy is widely used in data science, machine learning, and scientific computing applications. Method 1: Using pip (Recommended) The simplest ...

Read More
Showing 171–180 of 216 articles
« Prev 1 16 17 18 19 20 22 Next »
Advertisements