Found 10783 Articles for Python

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

Vikram Chiluka
Updated on 18-Aug-2022 08:43:57

12K+ Views

In this article, we will show you how to print all the longest words from a given text file using python. The longest words are the words which are having the same length as the longest word (maximum length) in a text file. Assume we have taken a text file with the name ExampleTextFile.txt consisting of some random text. We will return all the longest words from a given text file. ExampleTextFile.txt Good Morning Tutorials Point This is Tutorials Point sample File Consisting of Specific abbreviated source codes in Python Seaborn Scala Imagination Summary and Explanation Welcome user Learn with ... Read More

How to Split given list and insert in excel file using Python?

Vikram Chiluka
Updated on 18-Aug-2022 08:42:14

4K+ Views

In this article, we will show you how to split the list and insert those into an excel file using python. Assume we have taken a static list and split that list and insert those list items into an excel file, by returning an excel file say outputExcelFile.xlsx containing the below output. outputExcelFile.xlsx Player Name Country Virat Kohli India Bhuvaneshwar Kumar India Mahendra Singh Dhoni India Rashid Khan Afghanistan Hardik Pandya India David Warner Australia West Indies Kieron Pollard India Rohit Sharma ... Read More

How to get values of all rows in a particular column in openpyxl in Python?

Vikram Chiluka
Updated on 18-Aug-2022 08:37:39

8K+ Views

In this article, we will show you how to get all the row values of a particular column in an excel file using the python openpyxl library. Assume we have taken an excel file with the name sampleTutorialsPoint.xlsx containing some random data. We will return all the row values of a given particular column in an excel file. sampleTutorialsPoint.xlsx Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvaneshwar Kumar 34 Batsman India Sun Risers Hyderabad 333 140 Mahendra Singh Dhoni 39 Batsman ... Read More

How to get sheet names using openpyxl in Python?

Vikram Chiluka
Updated on 18-Aug-2022 08:39:44

14K+ Views

In this article, we will show you how to get all the sheet names found in an excel file using python openpyxl library. Assume we have taken an excel file with the name sampleTutorialsPoint.xlsx containing multiple sheets with some random data. We will return all the sheet names found in a given excel file using the sheetnames attribute. sampleTutorialsPoint.xlsx firstSheet Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvaneshwar Kumar 34 Batsman India Sun Risers Hyderabad 333 140 Mahendra Singh Dhoni 39 ... Read More

How to find the number of Blank and Non-Blank cells in the Excel table using Python?

Vikram Chiluka
Updated on 18-Aug-2022 08:32:17

2K+ Views

In this article, we will show you how to find the count of a number of blank and non-blank (filled) cells in an excel worksheet using python. Assume we have taken an excel file with the name demoTutorialsPoint.xlsx containing some random data with some blank cells. We will return the count of a number of blank and non-blank (filled) cells in an excel worksheet. sampleTutorialsPoint.xlsx Player Name Age Type Country Team Runs Wickets Virat Kohli Batsman India Royal Challengers Bangalore 20 34 Batsman India Sun Risers Hyderabad 333 140 ... Read More

How to find the frequency of a particular word in a cell of an excel table using Python?

Vikram Chiluka
Updated on 18-Aug-2022 08:29:02

691 Views

In this article, we will show you how to find the frequency (number of times the word occurs) of a specific word in a cell of a given excel file using python. Assume we have taken an excel file with the name TutorialsPoint.xlsx containing some random data. We will return the frequency of a given word in a cell of a given excel file. sampleTutorialsPoint.xlsx Player Name Age Type Country Team Runs Wickets Virat Kohli Batsman India Royal Challengers Bangalore 20 34 Batsman India Sun Risers Hyderabad 333 140 ... Read More

How to find the first empty row of an excel file in Python?

Vikram Chiluka
Updated on 18-Aug-2022 08:24:34

3K+ Views

In this article, we will show you how to find the index of a first empty row of a given excel file using python. Assume we have taken an excel file with the name demoTutorialsPoint.xlsx containing some random data with some empty rows. We will return the index of the first empty row in an excel worksheet. sampleTutorialsPoint.xlsx Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvaneshwar Kumar 34 Batsman India Sun Risers Hyderabad 333 140 Mahendra Singh Dhoni 39 Batsman India ... Read More

How to Copy Odd Lines of Text File to Another File using Python

Vikram Chiluka
Updated on 18-Aug-2022 08:06:55

3K+ Views

In this article, we will show you how to copy only odd lines of a text file to another text file using python. Assume we have taken a text file with the name TextFile.txt consisting of some random text. We need to copy just all the odd lines of a text file into another and print them. TextFile.txt Good Morning This is the Tutorials Point sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome everyone Learn with a joy Algorithm (Steps) Following are the Algorithm/steps to be followed to perform the desired task ... Read More

How to Convert Excel to CSV in Python

Vikram Chiluka
Updated on 29-Aug-2023 03:49:33

25K+ Views

In this article, we will show you how to convert an excel file to the CSV File (Comma Separated Values) using python. Assume we have taken an excel file with the name sampleTutorialsPoint.xlsx containing some random text. We will return a CSV File after converting the given excel file into a CSV file. sampleTutorialsPoint.xlsx Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvaneshwar Kumar 34 Batsman India Sun Risers Hyderabad 333 140 Mahendra Singh Dhoni 39 Batsman India Chennai Super Kings 4500 ... Read More

How to Convert CSV to Excel using Pandas in Python?

Vikram Chiluka
Updated on 18-Aug-2022 07:16:36

18K+ 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. Assume we have taken an excel file with the name ExampleCsvFile.csv containing some random text. We will return a CSV File after converting the given excel file into a CSV file. ExampleCsvFile.csv Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvneshwar Kumar34 Batsman India Sun Risers Hyderabad 333 140 Mahendra Singh Dhoni 39 Batsman India Chennai ... Read More

Advertisements