MCPcopy
hub / github.com/pandas-dev/pandas / coerce

Function coerce

pandas/core/tools/datetimes.py:1173–1184  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

1171 )
1172
1173 def coerce(values):
1174 # we allow coercion to if errors allows
1175 values = to_numeric(values, errors=errors)
1176
1177 # prevent prevision issues in case of float32 # GH#60506
1178 if is_float_dtype(values.dtype):
1179 values = values.astype("float64")
1180
1181 # prevent overflow in case of int8 or int16
1182 if is_integer_dtype(values.dtype):
1183 values = values.astype("int64")
1184 return values
1185
1186 values = (
1187 coerce(arg[unit_rev["year"]]) * 10000

Callers 1

Calls 4

to_numericFunction · 0.90
is_float_dtypeFunction · 0.90
is_integer_dtypeFunction · 0.90
astypeMethod · 0.45

Tested by

no test coverage detected