Skip to main content

Query dataframes, find issue with your notebook snippets as if a professional data scientist was pair coding with you

Project description

date-a-scientist Logo

date-a-scientist

Query dataframes, find issue with your notebook snippets as if a professional data scientist was pair coding with you.

Currently just a thin wrapper around an amazing library called pandas-ai by sinaptik-ai!

How to use it?

from date_a_scientist import DateAScientist
import pandas as pd

df = pd.DataFrame(
    [
        {"name": "Alice", "age": 25, "city": "New York"},
        {"name": "Bob", "age": 30, "city": "Los Angeles"},
        {"name": "Charlie", "age": 35, "city": "Chicago"},
    ]
)
ds = DateAScientist(
    df=df,
    llm_openai_api_token=...,  # your OpenAI API token goes here
    llm_model_name="gpt-3.5-turbo",  # by default, it uses "gpt-4o"
)

# should return "Alice"
ds.chat("What is the name of the first person?")

Additionally we can pass a description of fields, so that more meaningful questions can be asked:

ds = DateAScientist(
    df=df,
    llm_openai_api_token=...,  # your OpenAI API token goes here
    llm_model_name="gpt-3.5-turbo",  # by default, it uses "gpt-4o"
    column_descriptions={
        "name": "The name of the person",
        "age": "The age of the person",
        "city": "The city where the person lives",
    },
)

ds = DateAScientist(
    df=df,
    llm_openai_api_token=...,  # your OpenAI API token goes here
    llm_model_name="gpt-3.5-turbo",  # by default, it uses "gpt-4o"
)

# should return DataFrame with Chicago rows
ds.chat("Who lives in Chicago?")

Finally if you want to get the code that was generated, you can use ds.code():

ds.code("Who lives in Chicago?")

which will return monokai styled code. If you want to return plain code, you can use:

ds.code("Who lives in Chicago?", return_as_string=True)

Inspirations

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

date_a_scientist-0.1.17.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

date_a_scientist-0.1.17-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file date_a_scientist-0.1.17.tar.gz.

File metadata

  • Download URL: date_a_scientist-0.1.17.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Darwin/24.0.0

File hashes

Hashes for date_a_scientist-0.1.17.tar.gz
Algorithm Hash digest
SHA256 2a164c0873db41961dfc8a2f05f1f90939d706053ba96e79be11974436e452a1
MD5 33676ab38e1606fc961b66b0ecc6579f
BLAKE2b-256 b812fc4ba512814c6863fd0c96d983e8d72de9f71f09f7539ded339bf77f206b

See more details on using hashes here.

File details

Details for the file date_a_scientist-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: date_a_scientist-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Darwin/24.0.0

File hashes

Hashes for date_a_scientist-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 517684912042e92c74a16773f5e8d3b01934cf3e3e84efbf59805d48b0c81aae
MD5 0937a4f843b89bdf8ed59f46ccb28cae
BLAKE2b-256 c59e88d25c7afabb8de432b78b9582feafa6143e5cd93bfa0b328874addc05fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page