Pandas
In [ ]:
Copied!
# Install the opendal and pandas
!pip install opendal, pandas
# Install the opendal and pandas
!pip install opendal, pandas
In [ ]:
Copied!
import pandas as pd
import opendal
# Init an operator.
op = opendal.Operator("fs", root="/tmp")
# Create and write a csv file
op.write("test.csv", b"name,age\nAlice,25\nBob,30\nCharlie,35")
# Open and read the DataFrame from the file.
with op.open("test123.csv", mode="rb") as file:
read_df = pd.read_csv(file)
print(f"read_df: {read_df}")
import pandas as pd
import opendal
# Init an operator.
op = opendal.Operator("fs", root="/tmp")
# Create and write a csv file
op.write("test.csv", b"name,age\nAlice,25\nBob,30\nCharlie,35")
# Open and read the DataFrame from the file.
with op.open("test123.csv", mode="rb") as file:
read_df = pd.read_csv(file)
print(f"read_df: {read_df}")