Found 10805 Articles for Python

Readability Index in Python(NLP)?

Nitya Raut
Updated on 30-Jul-2019 22:30:25

980 Views

Natural language processing is the study of automated generation and understanding of natural human languages. This is becoming more and more interesting tasks to solve, as computer technology is integrated into almost every industry nowadays. We are going to study one specific field within natural language processing; readability. This involves the topic of determining the readability of a text. This indicates how difficult it is to read or understand a text.A readability index is a numeric value that indicates how difficult (or easy) it is to read and understand a text. There are several different tests for determining readability, and ... Read More

Deploying Scrapy spider on ScrapingHub

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

131 Views

Scrapy spiderScrapy spider is a class which provides the facility to follow the links of a website and extract the information from the webpages.This is the main class from which other spiders must inherit.ScrapinghubScrapinghub is an open source application to run Scrapy spiders. Scrapinghub turns web content into some useful data or information. It allows us to extract the data from webpages, even for complex webpages.We are going to use scrapinghub to deploy scrapy spiders on cloud and execute it.Steps to deploy spiders on scrapinghub −Step1 −Create one scrapy project −After installing scrapy, just run the following command in your ... Read More

Web Scraping using Python and Scrapy?

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

504 Views

One of the best frameworks for developing crawlers is scrapy. Scrapy is a popular web scraping and crawling framework utilizing high-level functionality to make scraping websites easier.Installation Installing scrapy in windows is easy: we can use either pip or conda(if you have anaconda). Scrapy runs on both python 2 and 3 versions.pip install ScrapyOrconda install –c conda-forge scrapyIf Scrapy is installed correctly, a scrapy command will now be available in the terminal −C:\Users\rajesh>scrapy Scrapy 1.6.0 - no active project Usage: scrapy [options] [args] Available commands: bench    Run quick benchmark test fetch    Fetch a URL using the ... Read More

Data visualization with different Charts in Python?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

218 Views

Python provides various easy to use libraries for data visualization. Good thing is that these libraries works with small or large datasets.Some of the most commonly used python libraries for data visualizations are −MatplotlibPandasPlotlySeabornBelow we are going to plot different types of visualization chart for one fixed data to better analyse that data.We are going to analyze below data set to visualize through different charts −Country or AreaYear(s)VariantValueIndia2019Medium1368737.513India2019High1378419.072India2019Low1359043.965India2019Constant fertility1373707.838India2019Instant replacement1366687.871India2019Zero migration1370868.782India2019Constant mortality1366282.778India2019No change1371221.64India2019Momentum1367400.614Basic Plot Let's create some basic plots: Line plots, scatter plots and histogramsLine PlotsLine graphs are plots where a line is drawn to indicate a relationship between a particular ... Read More

Data Analysis and Visualization in Python?

Nitya Raut
Updated on 30-Jul-2019 22:30:25

1K+ Views

Python provides numerous libraries for data analysis and visualization mainly numpy, pandas, matplotlib, seaborn etc. In this section, we are going to discuss pandas library for data analysis and visualization which is an open source library built on top of numpy.It allows us to do fast analysis and data cleaning and preparation.Pandas also provides numerous built-in visualization feautures which we are going to see below.InstallationTo install pandas, run the below command in your terminal −pipinstall pandasOrwe have anaconda, you can usecondainstall pandasPandas-DataFramesData framesa re the main tools when we are working with pandas.code −import numpy as np import pandas as ... Read More

List of Keywords in Python Programming

Anvi Jain
Updated on 11-Aug-2022 11:37:47

935 Views

Keywords in Python are reserved words. You cannot use them as variable name, function name, class name, etc. Following are the Keywords in Python − Keywords in Python FALSE await else import pass None break except in raise TRUE class finally is return and continue for lambda try as def from nonlocal while assert del global not with async ... Read More

Convert between binary and ASCII using Python (binascii)

Smita Kapse
Updated on 30-Jul-2019 22:30:25

710 Views

The binascii module enables conversion between binary and various ASCII encoded binary representations. The binascii module contains low-level functions written in C for greater speed. They are used by the higher-level modules such as uu, base64 or binhex modules.The binascii module defines the following functions. These function are named as a2b_* or b2a_*binascii.a2b_uu(string): Convert a single line of uuencoded data back to binary and return the binary data. Lines normally contain 45 (binary) bytes, except for the last line. Line data may be followed by white space.binascii.b2a_uu(data): Convert binary data to a line of ASCII characters, the return value is the converted ... Read More

Encode and decode binhex4 files using Python (binhex)

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

338 Views

The binhex module encodes and decodes files in binhex4 format. This format is used in the representation of Macintosh files in ASCII. Only the data fork is handled.The binhex module defines the following functions −binhex.binhex(input, output): Convert a binary file with filename input to binhex file output. The output parameter can either be a filename or a file-like object (any object supporting a write() and close() method).binhex.hexbin(input, output): Decode a binhex file input. input may be a filename or a file-like object supporting read() and close() methods. The resulting file is written to a file named output unless the argument is None ... Read More

Python Context Variables

Smita Kapse
Updated on 30-Jul-2019 22:30:25

984 Views

Context variable can have different values depending on its context. Unlike Thread-Local Storage where each execution thread may have a different value for a variable, a context variable may be several contexts in one execution thread. This is useful in keeping track of variables in concurrent asynchronous tasks.The ContextVar class is used to declare and work with Context Variables.import contextvars name = contextvars.ContextVar("name", default = 'Hello')The optional default parameter is returned by ContextVar.get() when no value for the variable is found in the current context.name: The name of the variable. This is a read-only property.Following methods are defined in ContextVar ... Read More

Python Interfaces to Unix databases (dbm)

Anvi Jain
Updated on 30-Jul-2019 22:30:25

156 Views

The dbm package in Python's built-in library provides a dictionary like an interface DBM style databases. The dbm library is a simple database engine, written by Ken Thompson. DBM stands for DataBase Manager, used by UNIX operating system, the library stores arbitrary data by use of a single key (a primary key) in fixed-size buckets and uses hashing techniques to enable fast retrieval of the data by key.There are following modules in dbm package −The dbm.ndbm module provides an interface to the Unix “(n)dbm” library. Dbm objects behave like dictionaries, with keys and values should be stored as bytes. The ... Read More

Advertisements