mirror of
https://github.com/corca-ai/EVAL
synced 2024-10-30 09:20:44 +00:00
12 lines
326 B
Python
12 lines
326 B
Python
|
import pandas as pd
|
||
|
from prompts.file import DATAFRAME_PROMPT
|
||
|
|
||
|
from .base import BaseHandler
|
||
|
|
||
|
|
||
|
class CsvToDataframe(BaseHandler):
|
||
|
def handle(self, filename: str):
|
||
|
df = pd.read_csv(filename)
|
||
|
description = str(df.describe())
|
||
|
return DATAFRAME_PROMPT.format(filename=filename, description=description)
|