# Python Client 'query\_data\_frame' does not return multiple DataFrames

**URL:** <https://community.influxdata.com/t/python-client-query-data-frame-does-not-return-multiple-dataframes/22955>\
**Category:** Client SDKs\
**Tags:** client-libraries, flux, python\
**Created:** [December 14, 2021, 11:08am UTC](https://community.influxdata.com/t/python-client-query-data-frame-does-not-return-multiple-dataframes/22955 "2021-12-14T11:08:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorkem](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@gorkem](https://community.influxdata.com/u/gorkem)\
**Post date:** [December 14, 2021, 11:08am UTC](https://community.influxdata.com/t/python-client-query-data-frame-does-not-return-multiple-dataframes/22955/1 "2021-12-14T11:08:36Z")

</div>

Hello,

In the documentation and ‘query\_api.py’ file, it says

> Note that if a query returns more then one table than the client generates a DataFrame for each of them.

So this query returns 2 tables as seen below,

 ![1](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/f/f0d0281281864a053aa115aca08b6e03100d9b38.png)

However, when I use query\_data\_frame(), there is only 1 dataframe, as seen below,

 ![2](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/e/e04976d0cc1c2d1bc7d0d86d781004afd1e217b7.png)

What I was expecting is something like this;

```auto
df_list = influx_query_api.query_data_frame(query=query)
for df in df_list:
    print(df)
   # work on each dataframe, etc..

```

so there should be 2 dataframes, right? as seen below

 ![3](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/1/102eb7ece9c8f434900d6414a869b254ce9d2cf2.png)  
 ![4](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/6/60639daad74d3ddfb17b3285beb76539c85b43a1.png)

what am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![bednar](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/bednar/32/3690_2.png) [@bednar](https://community.influxdata.com/u/bednar)\
**Post date:** [December 14, 2021, 11:29am UTC](https://community.influxdata.com/t/python-client-query-data-frame-does-not-return-multiple-dataframes/22955/2 "2021-12-14T11:29:26Z")

</div>

Hi @gorkem,

thanks for using our client.

The documentation does not describe it accurately. A new table is created when the results contains tables with different schemas. Something like:

```auto
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
#group,false,false,true,true,false,true,false,false
,result,table,_start,_stop,_time,region,host,_value
,mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43
,mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25
,mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62

#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
#group,false,false,true,true,false,true,false,false
,result,table,_start,_stop,_time,location,device,min,max
,mean,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,USA,5825,62.73,68.42
,mean,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,USA,2175,12.83,56.12
,mean,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,USA,6913,51.62,54.25

```

Regards
