@@ -1929,25 +1929,39 @@ def _get_bool_data(self):
1929
1929
1930
1930
def as_matrix (self , columns = None ):
1931
1931
"""
1932
- Convert the frame to its Numpy-array matrix representation. Columns
1933
- are presented in sorted order unless a specific list of columns is
1934
- provided.
1935
-
1936
- NOTE: the dtype will be a lower-common-denominator dtype (implicit
1937
- upcasting) that is to say if the dtypes (even of numeric types)
1938
- are mixed, the one that accommodates all will be chosen use this
1939
- with care if you are not dealing with the blocks
1940
-
1941
- e.g. if the dtypes are float16,float32 -> float32
1942
- float16,float32,float64 -> float64
1943
- int32,uint8 -> int32
1944
-
1932
+ Convert the frame to its Numpy-array representation.
1933
+
1934
+ Parameters
1935
+ ----------
1936
+ columns: list, optional, default:None
1937
+ If None, return all columns, otherwise, returns specified columns.
1945
1938
1946
1939
Returns
1947
1940
-------
1948
1941
values : ndarray
1949
1942
If the caller is heterogeneous and contains booleans or objects,
1950
- the result will be of dtype=object
1943
+ the result will be of dtype=object. See Notes.
1944
+
1945
+
1946
+ Notes
1947
+ -----
1948
+ Return is NOT a Numpy-matrix, rather, a Numpy-array.
1949
+
1950
+ The dtype will be a lower-common-denominator dtype (implicit
1951
+ upcasting); that is to say if the dtypes (even of numeric types)
1952
+ are mixed, the one that accommodates all will be chosen. Use this
1953
+ with care if you are not dealing with the blocks.
1954
+
1955
+ e.g. If the dtypes are float16 and float32, dtype will be upcast to
1956
+ float32. If dtypes are int32 and uint8, dtype will be upcase to
1957
+ int32.
1958
+
1959
+ This method is provided for backwards compatibility. Generally,
1960
+ it is recommended to use '.values'.
1961
+
1962
+ See Also
1963
+ --------
1964
+ pandas.DataFrame.values
1951
1965
"""
1952
1966
self ._consolidate_inplace ()
1953
1967
if self ._AXIS_REVERSED :
@@ -1956,7 +1970,19 @@ def as_matrix(self, columns=None):
1956
1970
1957
1971
@property
1958
1972
def values (self ):
1959
- "Numpy representation of NDFrame"
1973
+ """Numpy representation of NDFrame
1974
+
1975
+ Notes
1976
+ -----
1977
+ The dtype will be a lower-common-denominator dtype (implicit
1978
+ upcasting); that is to say if the dtypes (even of numeric types)
1979
+ are mixed, the one that accommodates all will be chosen. Use this
1980
+ with care if you are not dealing with the blocks.
1981
+
1982
+ e.g. If the dtypes are float16 and float32, dtype will be upcast to
1983
+ float32. If dtypes are int32 and uint8, dtype will be upcase to
1984
+ int32.
1985
+ """
1960
1986
return self .as_matrix ()
1961
1987
1962
1988
@property
0 commit comments