습관처럼
pandas.DataFrame(1) 본문
pandas.DataFrame.dtypes
Return.: the dtypes in the DataFrame.
This returns a Series with the data type of each column. The result’s index is the original DataFrame’s columns. Columns with mixed types are stored with the object dtype. See the User Guide for more.
pandas.DataFrame.astype
Cast a pandas object to a specified dtype dtype.
pandas.DataFrame.isna
Detect missing values.
Return: a boolean same-sized object indicating if the values are NA. NA values, such as None or numpy.NaN, gets mapped to True values. Everything else gets mapped to False values. Characters such as empty strings '' or numpy.inf are not considered NA values (unless you set pandas.options.mode.use_inf_as_na = True).
Returns : DataFrame
Mask of bool values for each element in DataFrame that indicates whether an element is not an NA value.
pandas.DataFrame.notna
Detect existing (non-missing) values.
Return: a boolean same-sized object indicating if the values are not NA. Non-missing values get mapped to True. Characters such as empty strings '' or numpy.inf are not considered NA values (unless you set pandas.options.mode.use_inf_as_na = True). NA values, such as None or numpy.NaN, get mapped to False values.
Returns: DataFrame
Mask of bool values for each element in DataFrame that indicates whether an element is not an NA value.
pandas.DataFrame.head
Return : the first n rows.
This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it.
For negative values of n, this function returns all rows except the last n rows, equivalent to df[:-n].
Parameters : n : int, default 5
Number of rows to select.
Returns : same type as caller
The first n rows of the caller object.
pandas.DataFrame.apply
DataFrame.apply(self, func, axis=0, raw=False, result_type=None, args=(), **kwds)
Apply a function along an axis of the DataFrame.
Objects passed to the function are Series objects whose index is either the DataFrame’s index (axis=0) or the DataFrame’s columns (axis=1). By default (result_type=None), the final return type is inferred from the return type of the applied function. Otherwise, it depends on the result_type argument.
Parameters :
func : function
Function to apply to each column or row.
axis : {0 or ‘index’, 1 or ‘columns’}, default 0
Axis along which the function is applied:
-
0 or ‘index’: apply function to each column.
-
1 or ‘columns’: apply function to each row.
raw : bool, default False
Determines if row or column is passed as a Series or ndarray object:
-
False : passes each row or column as a Series to the function.
-
True : the passed function will receive ndarray objects instead. If you are just applying a NumPy reduction function this will achieve much better performance.
result_type : {‘expand’, ‘reduce’, ‘broadcast’, None}, default None
These only act when axis=1 (columns):
-
‘expand’ : list-like results will be turned into columns.
-
‘reduce’ : returns a Series if possible rather than expanding list-like results. This is the opposite of ‘expand’.
-
‘broadcast’ : results will be broadcast to the original shape of the DataFrame, the original index and columns will be retained.
The default behaviour (None) depends on the return value of the applied function: list-like results will be returned as a Series of those. However if the apply function returns a Series these are expanded to columns.
New in version 0.23.0.
args : tuple
Positional arguments to pass to func in addition to the array/series.
**kwds :
Additional keyword arguments to pass as keywords arguments to func.
Returns : Series or DataFrame
Result of applying func along the given axis of the DataFrame.
pandas.DataFrame.isin
Whether each element in the DataFrame is contained in values.
Parameters : valuesiterable, Series, DataFrame or dict
The result will only be true at a location if all the labels match. If values is a Series, that’s the index. If values is a dict, the keys must be the column names, which must match. If values is a DataFrame, then both the index and column labels must match.
Returns : DataFrame
DataFrame of booleans showing whether each element in the DataFrame is contained in values.
pandas.DataFrame.transform
Call func on self producing a DataFrame with transformed values.
Produced DataFrame will have same axis length as self.
Parameters : func : function, str, list or dict
Function to use for transforming the data. If a function, must either work when passed a DataFrame or when passed to DataFrame.apply.
Accepted combinations are:
-
function
-
string function name
-
list of functions and/or function names, e.g. [np.exp. 'sqrt']
-
dict of axis labels -> functions, function names or list of such.
axis : {0 or ‘index’, 1 or ‘columns’}, default 0
If 0 or ‘index’: apply function to each column. If 1 or ‘columns’: apply function to each row.
*args
Positional arguments to pass to func.
**kwargs
Keyword arguments to pass to func.
Returns : DataFrame
A DataFrame that must have the same length as self.
pandas.DataFrame.groupby
pandas.DataFrame.describe
출처 : https://pandas.pydata.org/pandas-docs/stable/reference/frame.html
'Data Analysis & ML' 카테고리의 다른 글
Machine Learning - 언더 샘플링과 오버 샘플링 (0) | 2020.07.31 |
---|---|
데이터 분석의 유형 6가지 (0) | 2020.05.16 |
python을 활용한 EDA(탐색적 자료 분석, Exploratory Data Analysis) (0) | 2020.04.23 |
Jupyter notebook - %matplotlib inline (0) | 2020.03.02 |
Python 데이터 시각화 - 참고 사이트 (0) | 2020.03.01 |