code: def test_from_dtype_from_float(data):
      # construct from our dtype & string dtype
      dtype = data.dtype
  
      # from float
      expected = pd.Series(data)
      result = pd.Series(
          data.to_numpy(na_value=np.nan, dtype="float"),
          dtype=str(dtype),
      )
      tm.assert_series_equal(result, expected)
  
      # from int / list
      expected = pd.Series(data)
      result = pd.Series(np.array(data).tolist(), dtype=str(dtype))
      tm.assert_series_equal(result, expected)
  
      # from int / array
      expected = pd.Series(data).dropna().reset_index(drop=True)
      dropped = np.array(data.dropna()).astype(np.dtype(dtype.type))
      result = pd.Series(dropped, dtype=str(dtype))
      tm.assert_series_equal(result, expected)
  
imports: import numpy
  import pytest
  import pandas
  import pandas._testing
  from pandas.api.types import is_integer
  from pandas.core.arrays import IntegerArray
  from pandas.core.arrays.integer import Int8Dtype, Int32Dtype, Int64Dtype
label_desc: Use image node_id 3 for calling a global function with example usage: test_from_dtype_from_float(data) without return types