doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
stat.S_ISGID
Set-group-ID bit. This bit has several special uses. For a directory it indicates that BSD semantics is to be used for that directory: files created there inherit their group ID from the directory, not from the effective group ID of the creating process, and directories created there will also get the S_... | python.library.stat#stat.S_ISGID |
stat.S_ISLNK(mode)
Return non-zero if the mode is from a symbolic link. | python.library.stat#stat.S_ISLNK |
stat.S_ISPORT(mode)
Return non-zero if the mode is from an event port. New in version 3.4. | python.library.stat#stat.S_ISPORT |
stat.S_ISREG(mode)
Return non-zero if the mode is from a regular file. | python.library.stat#stat.S_ISREG |
stat.S_ISSOCK(mode)
Return non-zero if the mode is from a socket. | python.library.stat#stat.S_ISSOCK |
stat.S_ISUID
Set UID bit. | python.library.stat#stat.S_ISUID |
stat.S_ISVTX
Sticky bit. When this bit is set on a directory it means that a file in that directory can be renamed or deleted only by the owner of the file, by the owner of the directory, or by a privileged process. | python.library.stat#stat.S_ISVTX |
stat.S_ISWHT(mode)
Return non-zero if the mode is from a whiteout. New in version 3.4. | python.library.stat#stat.S_ISWHT |
stat.S_IWGRP
Group has write permission. | python.library.stat#stat.S_IWGRP |
stat.S_IWOTH
Others have write permission. | python.library.stat#stat.S_IWOTH |
stat.S_IWRITE
Unix V7 synonym for S_IWUSR. | python.library.stat#stat.S_IWRITE |
stat.S_IWUSR
Owner has write permission. | python.library.stat#stat.S_IWUSR |
stat.S_IXGRP
Group has execute permission. | python.library.stat#stat.S_IXGRP |
stat.S_IXOTH
Others have execute permission. | python.library.stat#stat.S_IXOTH |
stat.S_IXUSR
Owner has execute permission. | python.library.stat#stat.S_IXUSR |
stat.UF_APPEND
The file may only be appended to. | python.library.stat#stat.UF_APPEND |
stat.UF_COMPRESSED
The file is stored compressed (Mac OS X 10.6+). | python.library.stat#stat.UF_COMPRESSED |
stat.UF_HIDDEN
The file should not be displayed in a GUI (Mac OS X 10.5+). | python.library.stat#stat.UF_HIDDEN |
stat.UF_IMMUTABLE
The file may not be changed. | python.library.stat#stat.UF_IMMUTABLE |
stat.UF_NODUMP
Do not dump the file. | python.library.stat#stat.UF_NODUMP |
stat.UF_NOUNLINK
The file may not be renamed or deleted. | python.library.stat#stat.UF_NOUNLINK |
stat.UF_OPAQUE
The directory is opaque when viewed through a union stack. | python.library.stat#stat.UF_OPAQUE |
@staticmethod
Transform a method into a static method. A static method does not receive an implicit first argument. To declare a static method, use this idiom: class C:
@staticmethod
def f(arg1, arg2, ...): ...
The @staticmethod form is a function decorator – see Function definitions for details. A static me... | python.library.functions#staticmethod |
statistics — Mathematical statistics functions New in version 3.4. Source code: Lib/statistics.py This module provides functions for calculating mathematical statistics of numeric (Real-valued) data. The module is not intended to be a competitor to third-party libraries such as NumPy, SciPy, or proprietary full-featu... | python.library.statistics |
statistics.fmean(data)
Convert data to floats and compute the arithmetic mean. This runs faster than the mean() function and it always returns a float. The data may be a sequence or iterable. If the input dataset is empty, raises a StatisticsError. >>> fmean([3.5, 4.0, 5.25])
4.25
New in version 3.8. | python.library.statistics#statistics.fmean |
statistics.geometric_mean(data)
Convert data to floats and compute the geometric mean. The geometric mean indicates the central tendency or typical value of the data using the product of the values (as opposed to the arithmetic mean which uses their sum). Raises a StatisticsError if the input dataset is empty, if it ... | python.library.statistics#statistics.geometric_mean |
statistics.harmonic_mean(data)
Return the harmonic mean of data, a sequence or iterable of real-valued numbers. The harmonic mean, sometimes called the subcontrary mean, is the reciprocal of the arithmetic mean() of the reciprocals of the data. For example, the harmonic mean of three values a, b and c will be equival... | python.library.statistics#statistics.harmonic_mean |
statistics.mean(data)
Return the sample arithmetic mean of data which can be a sequence or iterable. The arithmetic mean is the sum of the data divided by the number of data points. It is commonly called “the average”, although it is only one of many different mathematical averages. It is a measure of the central loc... | python.library.statistics#statistics.mean |
statistics.median(data)
Return the median (middle value) of numeric data, using the common “mean of middle two” method. If data is empty, StatisticsError is raised. data can be a sequence or iterable. The median is a robust measure of central location and is less affected by the presence of outliers. When the number ... | python.library.statistics#statistics.median |
statistics.median_grouped(data, interval=1)
Return the median of grouped continuous data, calculated as the 50th percentile, using interpolation. If data is empty, StatisticsError is raised. data can be a sequence or iterable. >>> median_grouped([52, 52, 53, 54])
52.5
In the following example, the data are rounded, ... | python.library.statistics#statistics.median_grouped |
statistics.median_high(data)
Return the high median of data. If data is empty, StatisticsError is raised. data can be a sequence or iterable. The high median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the larger of the two middle values is... | python.library.statistics#statistics.median_high |
statistics.median_low(data)
Return the low median of numeric data. If data is empty, StatisticsError is raised. data can be a sequence or iterable. The low median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the smaller of the two middle val... | python.library.statistics#statistics.median_low |
statistics.mode(data)
Return the single most common data point from discrete or nominal data. The mode (when it exists) is the most typical value and serves as a measure of central location. If there are multiple modes with the same frequency, returns the first one encountered in the data. If the smallest or largest ... | python.library.statistics#statistics.mode |
statistics.multimode(data)
Return a list of the most frequently occurring values in the order they were first encountered in the data. Will return more than one result if there are multiple modes or an empty list if the data is empty: >>> multimode('aabbbbccddddeeffffgg')
['b', 'd', 'f']
>>> multimode('')
[]
New in... | python.library.statistics#statistics.multimode |
class statistics.NormalDist(mu=0.0, sigma=1.0)
Returns a new NormalDist object where mu represents the arithmetic mean and sigma represents the standard deviation. If sigma is negative, raises StatisticsError.
mean
A read-only property for the arithmetic mean of a normal distribution.
median
A read-only pro... | python.library.statistics#statistics.NormalDist |
cdf(x)
Using a cumulative distribution function (cdf), compute the probability that a random variable X will be less than or equal to x. Mathematically, it is written P(X <= x). | python.library.statistics#statistics.NormalDist.cdf |
classmethod from_samples(data)
Makes a normal distribution instance with mu and sigma parameters estimated from the data using fmean() and stdev(). The data can be any iterable and should consist of values that can be converted to type float. If data does not contain at least two elements, raises StatisticsError beca... | python.library.statistics#statistics.NormalDist.from_samples |
inv_cdf(p)
Compute the inverse cumulative distribution function, also known as the quantile function or the percent-point function. Mathematically, it is written x : P(X <= x) = p. Finds the value x of the random variable X such that the probability of the variable being less than or equal to that value equals the gi... | python.library.statistics#statistics.NormalDist.inv_cdf |
mean
A read-only property for the arithmetic mean of a normal distribution. | python.library.statistics#statistics.NormalDist.mean |
median
A read-only property for the median of a normal distribution. | python.library.statistics#statistics.NormalDist.median |
mode
A read-only property for the mode of a normal distribution. | python.library.statistics#statistics.NormalDist.mode |
overlap(other)
Measures the agreement between two normal probability distributions. Returns a value between 0.0 and 1.0 giving the overlapping area for the two probability density functions. | python.library.statistics#statistics.NormalDist.overlap |
pdf(x)
Using a probability density function (pdf), compute the relative likelihood that a random variable X will be near the given value x. Mathematically, it is the limit of the ratio P(x <=
X < x+dx) / dx as dx approaches zero. The relative likelihood is computed as the probability of a sample occurring in a narrow... | python.library.statistics#statistics.NormalDist.pdf |
quantiles(n=4)
Divide the normal distribution into n continuous intervals with equal probability. Returns a list of (n - 1) cut points separating the intervals. Set n to 4 for quartiles (the default). Set n to 10 for deciles. Set n to 100 for percentiles which gives the 99 cuts points that separate the normal distrib... | python.library.statistics#statistics.NormalDist.quantiles |
samples(n, *, seed=None)
Generates n random samples for a given mean and standard deviation. Returns a list of float values. If seed is given, creates a new instance of the underlying random number generator. This is useful for creating reproducible results, even in a multi-threading context. | python.library.statistics#statistics.NormalDist.samples |
stdev
A read-only property for the standard deviation of a normal distribution. | python.library.statistics#statistics.NormalDist.stdev |
variance
A read-only property for the variance of a normal distribution. Equal to the square of the standard deviation. | python.library.statistics#statistics.NormalDist.variance |
zscore(x)
Compute the Standard Score describing x in terms of the number of standard deviations above or below the mean of the normal distribution: (x - mean) / stdev. New in version 3.9. | python.library.statistics#statistics.NormalDist.zscore |
statistics.pstdev(data, mu=None)
Return the population standard deviation (the square root of the population variance). See pvariance() for arguments and other details. >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
0.986893273527251 | python.library.statistics#statistics.pstdev |
statistics.pvariance(data, mu=None)
Return the population variance of data, a non-empty sequence or iterable of real-valued numbers. Variance, or second moment about the mean, is a measure of the variability (spread or dispersion) of data. A large variance indicates that the data is spread out; a small variance indic... | python.library.statistics#statistics.pvariance |
statistics.quantiles(data, *, n=4, method='exclusive')
Divide data into n continuous intervals with equal probability. Returns a list of n - 1 cut points separating the intervals. Set n to 4 for quartiles (the default). Set n to 10 for deciles. Set n to 100 for percentiles which gives the 99 cuts points that separate... | python.library.statistics#statistics.quantiles |
exception statistics.StatisticsError
Subclass of ValueError for statistics-related exceptions. | python.library.statistics#statistics.StatisticsError |
statistics.stdev(data, xbar=None)
Return the sample standard deviation (the square root of the sample variance). See variance() for arguments and other details. >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
1.0810874155219827 | python.library.statistics#statistics.stdev |
statistics.variance(data, xbar=None)
Return the sample variance of data, an iterable of at least two real-valued numbers. Variance, or second moment about the mean, is a measure of the variability (spread or dispersion) of data. A large variance indicates that the data is spread out; a small variance indicates it is ... | python.library.statistics#statistics.variance |
exception StopAsyncIteration
Must be raised by __anext__() method of an asynchronous iterator object to stop the iteration. New in version 3.5. | python.library.exceptions#StopAsyncIteration |
exception StopIteration
Raised by built-in function next() and an iterator’s __next__() method to signal that there are no further items produced by the iterator. The exception object has a single attribute value, which is given as an argument when constructing the exception, and defaults to None. When a generator or... | python.library.exceptions#StopIteration |
class str(object='')
class str(object=b'', encoding='utf-8', errors='strict')
Return a str version of object. See str() for details. str is the built-in string class. For general information about strings, see Text Sequence Type — str. | python.library.functions#str |
class str(object='')
class str(object=b'', encoding='utf-8', errors='strict')
Return a string version of object. If object is not provided, returns the empty string. Otherwise, the behavior of str() depends on whether encoding or errors is given, as follows. If neither encoding nor errors is given, str(object) retu... | python.library.stdtypes#str |
str.capitalize()
Return a copy of the string with its first character capitalized and the rest lowercased. Changed in version 3.8: The first character is now put into titlecase rather than uppercase. This means that characters like digraphs will only have their first letter capitalized, instead of the full character... | python.library.stdtypes#str.capitalize |
str.casefold()
Return a casefolded copy of the string. Casefolded strings may be used for caseless matching. Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter 'ß' is equivalent to "ss". Since it is alr... | python.library.stdtypes#str.casefold |
str.center(width[, fillchar])
Return centered in a string of length width. Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s). | python.library.stdtypes#str.center |
str.count(sub[, start[, end]])
Return the number of non-overlapping occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation. | python.library.stdtypes#str.count |
str.encode(encoding="utf-8", errors="strict")
Return an encoded version of the string as a bytes object. Default encoding is 'utf-8'. errors may be given to set a different error handling scheme. The default for errors is 'strict', meaning that encoding errors raise a UnicodeError. Other possible values are 'ignore',... | python.library.stdtypes#str.encode |
str.endswith(suffix[, start[, end]])
Return True if the string ends with the specified suffix, otherwise return False. suffix can also be a tuple of suffixes to look for. With optional start, test beginning at that position. With optional end, stop comparing at that position. | python.library.stdtypes#str.endswith |
str.expandtabs(tabsize=8)
Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. Tab positions occur every tabsize characters (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the string, the current ... | python.library.stdtypes#str.expandtabs |
str.find(sub[, start[, end]])
Return the lowest index in the string where substring sub is found within the slice s[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 if sub is not found. Note The find() method should be used only if you need to know the position of sub. To ... | python.library.stdtypes#str.find |
str.format(*args, **kwargs)
Perform a string formatting operation. The string on which this method is called can contain literal text or replacement fields delimited by braces {}. Each replacement field contains either the numeric index of a positional argument, or the name of a keyword argument. Returns a copy of th... | python.library.stdtypes#str.format |
str.format_map(mapping)
Similar to str.format(**mapping), except that mapping is used directly and not copied to a dict. This is useful if for example mapping is a dict subclass: >>> class Default(dict):
... def __missing__(self, key):
... return key
...
>>> '{name} was born in {country}'.format_map(Defau... | python.library.stdtypes#str.format_map |
str.index(sub[, start[, end]])
Like find(), but raise ValueError when the substring is not found. | python.library.stdtypes#str.index |
str.isalnum()
Return True if all characters in the string are alphanumeric and there is at least one character, False otherwise. A character c is alphanumeric if one of the following returns True: c.isalpha(), c.isdecimal(), c.isdigit(), or c.isnumeric(). | python.library.stdtypes#str.isalnum |
str.isalpha()
Return True if all characters in the string are alphabetic and there is at least one character, False otherwise. Alphabetic characters are those characters defined in the Unicode character database as “Letter”, i.e., those with general category property being one of “Lm”, “Lt”, “Lu”, “Ll”, or “Lo”. Note... | python.library.stdtypes#str.isalpha |
str.isascii()
Return True if the string is empty or all characters in the string are ASCII, False otherwise. ASCII characters have code points in the range U+0000-U+007F. New in version 3.7. | python.library.stdtypes#str.isascii |
str.isdecimal()
Return True if all characters in the string are decimal characters and there is at least one character, False otherwise. Decimal characters are those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal character is a character in the Unicode General Ca... | python.library.stdtypes#str.isdecimal |
str.isdigit()
Return True if all characters in the string are digits and there is at least one character, False otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers in base 10, like the... | python.library.stdtypes#str.isdigit |
str.isidentifier()
Return True if the string is a valid identifier according to the language definition, section Identifiers and keywords. Call keyword.iskeyword() to test whether string s is a reserved identifier, such as def and class. Example: >>> from keyword import iskeyword
>>> 'hello'.isidentifier(), iskeywor... | python.library.stdtypes#str.isidentifier |
str.islower()
Return True if all cased characters 4 in the string are lowercase and there is at least one cased character, False otherwise. | python.library.stdtypes#str.islower |
str.isnumeric()
Return True if all characters in the string are numeric characters, and there is at least one character, False otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters a... | python.library.stdtypes#str.isnumeric |
str.isprintable()
Return True if all characters in the string are printable or the string is empty, False otherwise. Nonprintable characters are those characters defined in the Unicode character database as “Other” or “Separator”, excepting the ASCII space (0x20) which is considered printable. (Note that printable ch... | python.library.stdtypes#str.isprintable |
str.isspace()
Return True if there are only whitespace characters in the string and there is at least one character, False otherwise. A character is whitespace if in the Unicode character database (see unicodedata), either its general category is Zs (“Separator, space”), or its bidirectional class is one of WS, B, or... | python.library.stdtypes#str.isspace |
str.istitle()
Return True if the string is a titlecased string and there is at least one character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return False otherwise. | python.library.stdtypes#str.istitle |
str.isupper()
Return True if all cased characters 4 in the string are uppercase and there is at least one cased character, False otherwise. >>> 'BANANA'.isupper()
True
>>> 'banana'.isupper()
False
>>> 'baNana'.isupper()
False
>>> ' '.isupper()
False | python.library.stdtypes#str.isupper |
str.join(iterable)
Return a string which is the concatenation of the strings in iterable. A TypeError will be raised if there are any non-string values in iterable, including bytes objects. The separator between elements is the string providing this method. | python.library.stdtypes#str.join |
str.ljust(width[, fillchar])
Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s). | python.library.stdtypes#str.ljust |
str.lower()
Return a copy of the string with all the cased characters 4 converted to lowercase. The lowercasing algorithm used is described in section 3.13 of the Unicode Standard. | python.library.stdtypes#str.lower |
str.lstrip([chars])
Return a copy of the string with leading characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is not a prefix; rather, all combinations of its values are strippe... | python.library.stdtypes#str.lstrip |
static str.maketrans(x[, y[, z]])
This static method returns a translation table usable for str.translate(). If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or None. Character keys will t... | python.library.stdtypes#str.maketrans |
str.partition(sep)
Split the string at the first occurrence of sep, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings. | python.library.stdtypes#str.partition |
str.removeprefix(prefix, /)
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string: >>> 'TestHook'.removeprefix('Test')
'Hook'
>>> 'BaseTestCase'.removeprefix('Test')
'BaseTestCase'
New in version 3.9. | python.library.stdtypes#str.removeprefix |
str.removesuffix(suffix, /)
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string: >>> 'MiscTests'.removesuffix('Tests')
'Misc'
>>> 'TmpDirMixin'.removesuffix('Tests')
'TmpDirMixin'
New in version 3.9. | python.library.stdtypes#str.removesuffix |
str.replace(old, new[, count])
Return a copy of the string with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced. | python.library.stdtypes#str.replace |
str.rfind(sub[, start[, end]])
Return the highest index in the string where substring sub is found, such that sub is contained within s[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. | python.library.stdtypes#str.rfind |
str.rindex(sub[, start[, end]])
Like rfind() but raises ValueError when the substring sub is not found. | python.library.stdtypes#str.rindex |
str.rjust(width[, fillchar])
Return the string right justified in a string of length width. Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s). | python.library.stdtypes#str.rjust |
str.rpartition(sep)
Split the string at the last occurrence of sep, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself. | python.library.stdtypes#str.rpartition |
str.rsplit(sep=None, maxsplit=-1)
Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done, the rightmost ones. If sep is not specified or None, any whitespace string is a separator. Except for splitting from the right, rsplit() behaves like s... | python.library.stdtypes#str.rsplit |
str.rstrip([chars])
Return a copy of the string with trailing characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is not a suffix; rather, all combinations of its values are stripp... | python.library.stdtypes#str.rstrip |
str.split(sep=None, maxsplit=-1)
Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done (thus, the list will have at most maxsplit+1 elements). If maxsplit is not specified or -1, then there is no limit on the number of splits (all possible ... | python.library.stdtypes#str.split |
str.splitlines([keepends])
Return a list of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless keepends is given and true. This method splits on the following line boundaries. In particular, the boundaries are a superset of universal newlines.
Representa... | python.library.stdtypes#str.splitlines |
str.startswith(prefix[, start[, end]])
Return True if string starts with the prefix, otherwise return False. prefix can also be a tuple of prefixes to look for. With optional start, test string beginning at that position. With optional end, stop comparing string at that position. | python.library.stdtypes#str.startswith |
str.strip([chars])
Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is not a prefix or suffix; rather, all combinations... | python.library.stdtypes#str.strip |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.