redash icon indicating copy to clipboard operation
redash copied to clipboard

Can Python be used directly?

Open dclong opened this issue 7 years ago • 5 comments

  1. Can I use Python pandas to manipulate data directly. If so, is there any example on this?

  2. Can I use Python visualization libraries (e.g., Bokeh or Plotly) for visualization directly?

dclong avatar Jan 07 '18 06:01 dclong

Would be great to integrate Redash with Jupyter: have the query result be a cell input, and export cells as graphs for the dashboard.

lkraider avatar Feb 06 '18 21:02 lkraider

@dclong It really depends. There are many workarounds. Here is one simple way to get pandas data frame (if you already have the necessary modules installed):

redash_query_results = get_query_result(1) data = redash_query_results['rows'] # extract raw data from Redash query results

def redash_to_df(raw_data): import pandas as pd return pd.DataFrame.from_records(raw_data)

df = redash_to_df(data)

Also, check this very helpful functions on how to get the return dataframe to Redash data #2078

ghost avatar Apr 11 '18 15:04 ghost

Question: How to enable the Python Query Runner on the Docker release?

Answer: Edit docker-compose.production.yml and set in the environment: section:

REDASH_ADDITIONAL_QUERY_RUNNERS: "redash.query_runner.python"

PS: fixed the link https://github.com/getredash/redash/issues/2078

edit: found the answer

lkraider avatar Apr 11 '18 17:04 lkraider

i add python as data source to redash but when import mysql.connector module inside redash get me this error Error running query: <type 'exceptions.AttributeError'> 'module' object has no attribute 'connector' how to solve it ??

Amirashaker avatar Jun 24 '19 09:06 Amirashaker

  • Can I use Python pandas to manipulate data directly. If so, is there any example on this?
  • Can I use Python visualization libraries (e.g., Bokeh or Plotly) for visualization directly?

Hi, this question is very important from a data scienc purpose. However, this question is not answered by anyone. Is it possible to do this???

ogreyesp avatar Nov 06 '22 11:11 ogreyesp