작성
·
202
답변 1
1
안녕하세요.
좋은질문을 해주셨네요.
소괄호가 붙고 안 붙고의 차이는 Attributes 와 Methods 의 차이입니다.
아래 판다스 DataFrame의 Attributes 와 Methods 목록을 가져왔는데요.
가장 큰 차이는 옵션이 있는지 없는지에 대한 차이가 될거 같아요.
예를 들어 shape는 반환값이 (행, 열) 튜플로 반환이 되는데 이건 옵션이 따로 있지 않아요.
head()는 메소드인데 n 값에 대한 옵션이 있어요.
아래는 DataFrame 의 API 목록인데 Series 를 사용하더라도 같은 방법으로 대부분 사용하실 수 있습니다.
아래 링크를 참고해 보세요.
[pandas.DataFrame — pandas 1.0.3 documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html)
Attributes
Transpose index and columns. |
|
Access a single value for a row/column label pair. |
|
Dictionary of global attributes on this object. |
|
Return a list representing the axes of the DataFrame. |
|
The column labels of the DataFrame. |
|
Return the dtypes in the DataFrame. |
|
Indicator whether DataFrame is empty. |
|
Access a single value for a row/column pair by integer position. |
|
Purely integer-location based indexing for selection by position. |
|
The index (row labels) of the DataFrame. |
|
Access a group of rows and columns by label(s) or a boolean array. |
|
Return an int representing the number of axes / array dimensions. |
|
Return a tuple representing the dimensionality of the DataFrame. |
|
Return an int representing the number of elements in this object. |
|
Returns a Styler object. |
|
Return a Numpy representation of the DataFrame. |
Methods
|
Return a Series/DataFrame with absolute numeric value of each element. |
|
Get Addition of dataframe and other, element-wise (binary operator add). |
|
Prefix labels with string prefix. |
|
Suffix labels with string suffix. |
|
Aggregate using one or more operations over the specified axis. |
|
Aggregate using one or more operations over the specified axis. |
|
Align two objects on their axes with the specified join method. |
|
Return whether all elements are True, potentially over an axis. |
|
Return whether any element is True, potentially over an axis. |
|
Append rows of other to the end of caller, returning a new object. |
|
Apply a function along an axis of the DataFrame. |
|
Apply a function to a Dataframe elementwise. |
|
Convert TimeSeries to specified frequency. |
|
Return the last row(s) without any NaNs before where. |
|
Assign new columns to a DataFrame. |
|
Cast a pandas object to a specified dtype |
|
Select values at particular time of day (e.g. |
|
Select values between particular times of the day (e.g., 9:00-9:30 AM). |
|
Synonym for |
|
Return the bool of a single element PandasObject. |
|
Make a box plot from DataFrame columns. |
|
Trim values at input threshold(s). |
|
Perform column-wise combine with another DataFrame. |
|
Update null elements with value in the same location in other. |
|
Convert columns to best possible dtypes using dtypes supporting |
|
Make a copy of this object’s indices and data. |
|
Compute pairwise correlation of columns, excluding NA/null values. |
|
Compute pairwise correlation. |
|
Count non-NA cells for each column or row. |
|
Compute pairwise covariance of columns, excluding NA/null values. |
|
Return cumulative maximum over a DataFrame or Series axis. |
|
Return cumulative minimum over a DataFrame or Series axis. |
|
Return cumulative product over a DataFrame or Series axis. |
|
Return cumulative sum over a DataFrame or Series axis. |
|
Generate descriptive statistics. |
|
First discrete difference of element. |
|
Get Floating division of dataframe and other, element-wise (binary operator truediv). |
|
Get Floating division of dataframe and other, element-wise (binary operator truediv). |
|
Compute the matrix multiplication between the DataFrame and other. |
|
Drop specified labels from rows or columns. |
|
Return DataFrame with duplicate rows removed. |
|
Return DataFrame with requested index / column level(s) removed. |
|
Remove missing values. |
|
Return boolean Series denoting duplicate rows. |
|
Get Equal to of dataframe and other, element-wise (binary operator eq). |
|
Test whether two objects contain the same elements. |
|
Evaluate a string describing operations on DataFrame columns. |
|
Provide exponential weighted functions. |