MCPcopy
hub / github.com/python-visualization/folium / if_pandas_df_convert_to_numpy

Function if_pandas_df_convert_to_numpy

folium/utilities.py:152–161  ·  view source on GitHub ↗

Return a Numpy array from a Pandas dataframe. Iterating over a DataFrame has weird side effects, such as the first row being the column names. Converting to Numpy is more safe.

(obj: Any)

Source from the content-addressed store, hash-verified

150
151
152def if_pandas_df_convert_to_numpy(obj: Any) -> Any:
153 """Return a Numpy array from a Pandas dataframe.
154
155 Iterating over a DataFrame has weird side effects, such as the first
156 row being the column names. Converting to Numpy is more safe.
157 """
158 if pd is not None and isinstance(obj, pd.DataFrame):
159 return obj.values
160 else:
161 return obj
162
163
164def image_to_url(

Callers 5

__init__Method · 0.90
__init__Method · 0.90
validate_locationsFunction · 0.85
validate_multi_locationsFunction · 0.85

Calls

no outgoing calls

Tested by 1