Found 10784 Articles for Python

Python: How to put a border around an OptionMenu using Tkinter?

Kiran Kumar Panigrahi
Updated on 05-Sep-2023 11:33:48

313 Views

To save the contents of a Textbox in Tkinter, we can take the following steps − Create an instance of tkinter frame. Set the size of the frame using win.geometry method. Define a user-defined method "open_text" to open a text file in "read" mode. Read the contents of the text file and save it in a variable called "content". Then, use the "insert" method to insert the content in a Textbox. Next, define another user-defined method called "save_text" and in it, use the "write" method to save the contents of the textbox in the text file. Create ... Read More

All types of ambiguities in NLP

Aaryamaan Kartha
Updated on 13-Jul-2023 14:17:05

4K+ Views

Since Natural language can be open to multiple interpretations at times, this would pass on to the computers who will try to understand the natural language input given to them. Often, it can be difficult to fully understand a sentence when we are not given enough context or if there is poor grammar. In this article we will be going over many different types of ambiguities that are found in NLP. Part Of Speech (POS) Tagging Ambiguity POS tagging refers to the process of classifying words in a text to a part of speech - whether the word is ... Read More

NLP language models_ What are they_ Example with N-grams

Aaryamaan Kartha
Updated on 19-Jul-2023 10:19:05

200 Views

Language models in NLP are statistically generated computational models that capture relations between words and phrases to generate new text. Essentially, they can find the probability of the next word in a given sequence of words and also the probability of a entire sequence of words. These language models are important as they help in various NLP tasks such as machine translation, language generation, and word completion among others. You may not realize it, but when typing on computers or phones often the corrections made and your writing are essentially guided by NLP; Word completion and sometimes error detection ... Read More

How to Conduct a Two Sample T-Test in Python?

Sohail Tabrez
Updated on 13-Jul-2023 10:52:49

905 Views

Introduction The means of two groups are compared in statistics to see if they differ substantially from one another using a two-sample t-test. The test is frequently employed in scientific studies to ascertain whether two groups differ significantly on the basis of a continuous variable. In this article, we'll look at how to use Python's scipy.stats module to perform a two-sample t-test. Conducting a Two Sample T-Test Let's first understand the theory underlying the two-sample t-test before moving on to the implementation. The test assumes that the two sample populations are normally distributed with similar variances. The two groups' means ... Read More

How to Conduct a One Sample T-Test in Python?

Sohail Tabrez
Updated on 13-Jul-2023 10:50:52

868 Views

Introduction One Sample T-Test is a statistical hypothesis test used to determine whether a population mean is significantly different from a hypothesised value. Python gives us the resources we need to carry out this test. In this article, we will walk through how to conduct a One Sample T-Test in Python using the SciPy library. Conducting a One Sample T-Test The first step in conducting a One Sample T-Test is to state the null and alternative hypotheses. The null hypothesis is the assumption that the population mean is equal to the hypothesized value. The alternative hypothesis is the opposite of ... Read More

Python Program to Extract Strings between HTML Tags

Devesh Chauhan
Updated on 12-Jul-2023 13:53:54

798 Views

HTML tags are used to design the skeleton of websites. We pass information and upload content in the form of strings enclosed within the tags. The strings between the HTML tags determines how the element will be displayed and interpreted by the browser. Therefore, the extraction of these strings plays a crucial role in data manipulation and processing. We can analyse and understand the structure of the HTML document. These strings reveal the hidden pattern and logic behind the construction of a webpage. In this article, we will be dealing with these strings. Our task is to extract the ... Read More

Python Program to Extract String Till First Non-Alphanumeric Character

Devesh Chauhan
Updated on 12-Jul-2023 13:51:42

257 Views

Python strings are sequence of characters that represent information or data. A normal string can contain various characters that are enclosed within single or double quotes but an Alphanumeric string only consist of digits and letters. Both alphanumeric and non-alphanumeric strings are used and applied in various scenarios including password protection, data processing and validation, formatting etc. Specific patterns can be identified and extracted. We can also provide different combinations using these types of strings. We will perform an operation based on these strings. Our task is to extract a string till first non-Alphanumeric character is encountered. Understanding the ... Read More

Python program to extract N largest dictionaries keys

Devesh Chauhan
Updated on 12-Jul-2023 13:50:05

134 Views

A python dictionary is a data structure that can be used for numerous operations making it a prolific programming tool. It stores data in the form of key-value pairs i.e., each data can be labelled with a unique key. Keys in dictionaries are identifiers that are associated with different values, these values can be accessed, modified and deleted. Based on the task, keys can be sorted and extracted in different orders. In this article, we will be discussing a similar concept of extracting N largest dictionaries keys. We will operate on these unique keys and extract the relevant data. ... Read More

Python Program to Extract Mesh Matching Strings

Devesh Chauhan
Updated on 12-Jul-2023 13:49:31

51 Views

Pattern recognition is an important programming concept. It allows us to retrieve specific data that satisfies a particular condition or match a particular sequence. This principle is helpful in various fields including language and image processing. String matching helps us to extract meaningful information from a large collection of data. In this article, we will be discussing a similar concept of extracting mesh matching strings from a given list of strings. Mesh matching focuses on the extraction “similar” strings of equal length, let’s discuss this problem in detail. Understanding the Problem The main concept is to extract similar ... Read More

Python program to extract key-value pairs with substring in a dictionary

Devesh Chauhan
Updated on 12-Jul-2023 13:47:49

699 Views

Dictionaries in python are data structures that store data in the form of key-value pairs. Each key is unique and it is associated with different values. A dictionary helps us to access and retrieve data efficiently allowing a programmer to build an optimized code. Specific key-value pairs can be extracted from a given dictionary based on different requirements. This selective item extraction helps us to produce a dictionary consisting of relevant information. In this article, we will be discussing a similar concept of item extraction from a dictionary based on a reference “substring”. Understanding the Problem We ... Read More

Advertisements