File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ def memory_usage_of_objects(arr: object[:]) -> int64_t:
106
106
def is_scalar (val: object ) -> bool:
107
107
"""
108
108
Return True if given value is scalar.
109
-
109
+
110
110
Parameters
111
111
----------
112
112
val : object
@@ -129,7 +129,7 @@ def is_scalar(val: object) -> bool:
129
129
-------
130
130
bool
131
131
Return True if given object is scalar , False otherwise
132
-
132
+
133
133
Examples
134
134
--------
135
135
>>> dt = pd.datetime.datetime(2018 , 10 , 3 )
@@ -138,15 +138,15 @@ def is_scalar(val: object) -> bool:
138
138
139
139
>>> pd.api.types.is_scalar([2, 3])
140
140
False
141
-
141
+
142
142
>>> pd.api.types.is_scalar({0: 1, 2: 3})
143
143
False
144
-
144
+
145
145
>>> pd.api.types.is_scalar((0, 2))
146
146
False
147
-
147
+
148
148
pandas supports PEP 3141 numbers:
149
-
149
+
150
150
>>> from fractions import Fraction
151
151
>>> pd.api.types.is_scalar(Fraction(3, 5))
152
152
True
You can’t perform that action at this time.
0 commit comments