How to create a Pandas Dataframe and Series ?
pandas.DataFrame
class pandas.DataFrame(data=None, index=None, columns=None, dtype=None, copy=False)[source]
Two-dimensional, size-mutable, potentially heterogeneous tabular data.
Data structure also contains labeled axes (rows and columns). Arithmetic operations align on both row and column labels. Can be thought of as a dict-like container for Series objects. The primary pandas data structure.
Parameters
datandarray (structured or homogeneous), Iterable, dict, or DataFrame
Dict can contain Series, arrays, constants, or list-like objects.
Changed in version 0.23.0: If data is a dict, column order follows insertion-order for Python 3.6 and later.
Changed in version 0.25.0: If data is a list of dicts, column order follows insertion-order for Python 3.6 and later.
indexIndex or array-like
Index to use for resulting frame. Will default to RangeIndex if no indexing information part of input data and no index provided.
columnsIndex or array-like
Column labels to use for resulting frame. Will default to RangeIndex (0, 1, 2, …, n) if no column labels are provided.
dtypedtype, default None
Data type to force. Only a single dtype is allowed. If None, infer.
copybool, default False
Copy data from inputs. Only affects DataFrame / 2d ndarray input.
pandas.Series
class pandas.Series(data=None, index=None, dtype=None, name=None, copy=False, fastpath=False)[source]
One-dimensional ndarray with axis labels (including time series).
Labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Statistical methods from ndarray have been overridden to automatically exclude missing data (currently represented as NaN).
Operations between Series (+, -, /, , *) align values based on their associated index values– they need not be the same length. The result index will be the sorted union of the two indexes.
Parameters
dataarray-like, Iterable, dict, or scalar value
Contains data stored in Series.
Changed in version 0.23.0: If data is a dict, argument order is maintained for Python 3.6 and later.
indexarray-like or Index (1d)
Values must be hashable and have the same length as data. Non-unique index values are allowed. Will default to RangeIndex (0, 1, 2, …, n) if not provided. If both a dict and index sequence are used, the index will override the keys found in the dict.
dtypestr, numpy.dtype, or ExtensionDtype, optional
Data type for the output Series. If not specified, this will be inferred from data. See the user guide for more usages.
namestr, optional
The name to give to the Series.
copybool, default False
Copy input data.
Смотрите видео How to create a Pandas Dataframe and Series ? | Pandas tutorial for Beginners | Dataframe & Series онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Engineers Revolution 16 Октябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 108 раз и оно понравилось 4 людям.