def _netcdf2pandas(self, netcdf_data, query_variables, start, end):
<EOL>try:<EOL><INDENT>time_var = '<STR_LIT:time>'<EOL>self.set_time(netcdf_data.variables[time_var])<EOL><DEDENT>except KeyError:<EOL><INDENT>time_var = '<STR_LIT>'<EOL>self.set_time(netcdf_data.variables[time_var])<EOL><DEDENT>data_dict = {}<EOL>for key, data in netcdf_data.variables.items():<EOL><INDENT>if key not in query_variables:<EOL><INDENT>continue<EOL><DEDENT>squeezed = data[:].squeeze()<EOL>if squeezed.ndim == <NUM_LIT:1>:<EOL><INDENT>data_dict[key] = squeezed<EOL><DEDENT>elif squeezed.ndim == <NUM_LIT:2>:<EOL><INDENT>for num, data_level in enumerate(squeezed.T):<EOL><INDENT>data_dict[key + '<STR_LIT:_>' + str(num)] = data_level<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>data = pd.DataFrame(data_dict, index=self.time)<EOL>data = data.sort_index().loc[start:end]<EOL>return data<EOL>
Transforms data from netcdf to pandas DataFrame.

Parameters
----------
data: netcdf
    Data returned from UNIDATA NCSS query.
query_variables: list
    The variables requested.
start: Timestamp
    The start time
end: Timestamp
    The end time

Returns
-------
pd.DataFrame