code: def test_from_pandas_dataframe():
      data = pd.DataFrame(
          np.random.rand(10, 10),
          columns=["c" + str(i) for i in range(10)],
      )
      df = from_pandas_df(data, chunk_size=4)
  
      pd.testing.assert_series_equal(df.op.dtypes, data.dtypes)
      assert isinstance(
          df.index_value._index_value, IndexValue.RangeIndex
      )
      assert df.index_value._index_value._slice == slice(0, 10, 1)
      assert df.index_value.is_monotonic_increasing is True
      assert df.index_value.is_monotonic_decreasing is False
      assert df.index_value.is_unique is True
      assert df.index_value.min_val == 0
      assert df.index_value.max_val == 9
      np.testing.assert_equal(
          df.columns_value._index_value._data, data.columns.values
      )
  
      df = tile(df)
  
      assert len(df.chunks) == 9
      pd.testing.assert_frame_equal(
          df.chunks[0].op.data, df.op.data.iloc[:4, :4]
      )
      assert df.chunks[0].index_value._index_value._slice == slice(
          0, 4, 1
      )
      assert (
          df.chunks[0].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[0].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[0].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[1].op.data, df.op.data.iloc[:4, 4:8]
      )
      assert df.chunks[1].index_value._index_value._slice == slice(
          0, 4, 1
      )
      assert (
          df.chunks[1].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[1].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[1].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[2].op.data, df.op.data.iloc[:4, 8:]
      )
      assert df.chunks[2].index_value._index_value._slice == slice(
          0, 4, 1
      )
      assert (
          df.chunks[2].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[2].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[2].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[3].op.data, df.op.data.iloc[4:8, :4]
      )
      assert df.chunks[3].index_value._index_value._slice == slice(
          4, 8, 1
      )
      assert (
          df.chunks[3].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[3].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[3].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[4].op.data, df.op.data.iloc[4:8, 4:8]
      )
      assert df.chunks[4].index_value._index_value._slice == slice(
          4, 8, 1
      )
      assert (
          df.chunks[4].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[4].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[4].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[5].op.data, df.op.data.iloc[4:8, 8:]
      )
      assert df.chunks[5].index_value._index_value._slice == slice(
          4, 8, 1
      )
      assert (
          df.chunks[5].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[5].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[5].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[6].op.data, df.op.data.iloc[8:, :4]
      )
      assert df.chunks[6].index_value._index_value._slice == slice(
          8, 10, 1
      )
      assert (
          df.chunks[6].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[6].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[6].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[7].op.data, df.op.data.iloc[8:, 4:8]
      )
      assert df.chunks[7].index_value._index_value._slice == slice(
          8, 10, 1
      )
      assert (
          df.chunks[7].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[7].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[7].index_value._index_value._is_unique is True
      pd.testing.assert_frame_equal(
          df.chunks[8].op.data, df.op.data.iloc[8:, 8:]
      )
      assert df.chunks[8].index_value._index_value._slice == slice(
          8, 10, 1
      )
      assert (
          df.chunks[8].index_value._index_value._is_monotonic_increasing
          is True
      )
      assert (
          df.chunks[8].index_value._index_value._is_monotonic_decreasing
          is False
      )
      assert df.chunks[8].index_value._index_value._is_unique is True
  
      data2 = data[::2]
      df2 = from_pandas_df(data2, chunk_size=4)
  
      pd.testing.assert_series_equal(df.op.dtypes, data2.dtypes)
      assert isinstance(
          df2.index_value._index_value, IndexValue.RangeIndex
      )
      assert df2.index_value._index_value._slice == slice(0, 10, 2)
  
      df2 = tile(df2)
  
      assert len(df2.chunks) == 6
      pd.testing.assert_frame_equal(
          df2.chunks[0].op.data, df2.op.data.iloc[:4, :4]
      )
      assert df2.chunks[0].index_value._index_value._slice == slice(
          0, 8, 2
      )
      pd.testing.assert_frame_equal(
          df2.chunks[1].op.data, df2.op.data.iloc[:4, 4:8]
      )
      assert df2.chunks[1].index_value._index_value._slice == slice(
          0, 8, 2
      )
      pd.testing.assert_frame_equal(
          df2.chunks[2].op.data, df2.op.data.iloc[:4, 8:]
      )
      assert df2.chunks[2].index_value._index_value._slice == slice(
          0, 8, 2
      )
      pd.testing.assert_frame_equal(
          df2.chunks[3].op.data, df2.op.data.iloc[4:, :4]
      )
      assert df2.chunks[3].index_value._index_value._slice == slice(
          8, 10, 2
      )
      pd.testing.assert_frame_equal(
          df2.chunks[4].op.data, df2.op.data.iloc[4:, 4:8]
      )
      assert df2.chunks[3].index_value._index_value._slice == slice(
          8, 10, 2
      )
      pd.testing.assert_frame_equal(
          df2.chunks[5].op.data, df2.op.data.iloc[4:, 8:]
      )
      assert df2.chunks[3].index_value._index_value._slice == slice(
          8, 10, 2
      )
  
      raw = pd.DataFrame(
          {
              "a": [
                  string.printable[i : i + 15]
                  for i in np.random.randint(
                      len(string.printable), size=100
                  )
              ],
              "b": np.random.rand(100),
          }
      )
      with option_context(
          {"chunk_store_limit": raw["a"].memory_usage(deep=True) / 10}
      ):
          df = tile(from_pandas_df(raw))
          # see GH#2985, empty chunks are wrongly generated
          assert len([ns for ns in df.nsplits[1] if ns == 0]) == 0
  
imports: import os
  import tempfile
  import shutil
  import string
  from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  from ....None import tensor
  from ....config import option_context
  from ....core import tile
  from ....tests.core import require_ray
  from ....utils import lazy_import
  from ...core import IndexValue, DatetimeIndex, Int64Index, Float64Index, MultiIndex
  from ..core import merge_small_files
  from ..dataframe import from_pandas
  from ..date_range import date_range
  from ..from_records import from_records
  from ..from_tensor import dataframe_from_tensor, series_from_tensor, dataframe_from_1d_tileables
  from ..index import from_pandas, from_tileable
  from ..read_csv import read_csv, DataFrameReadCSV
  from ..read_sql import read_sql_table, read_sql_query, DataFrameReadSQL
  from ..read_raydataset import read_ray_dataset, DataFrameReadRayDataset, read_ray_mldataset, DataFrameReadMLDataset
  from ...utils import ray_deprecate_ml_dataset
  from ..series import from_pandas
label_desc: Use image node_id 1 for calling a global function with example usage: test_from_pandas_dataframe() without return types