Skip to main content

Exported results, including data tables, charts and graphs, can be downloaded and saved to your computer.

Depending on the terms agreed in your Data Sharing Agreement, you may be required to have your results reviewed by our Safe Output Service before they can be downloaded.

For more information on DSAs, visit Access the Secure Data Environment (Data Sharing Agreements).


Reviewing results

If your DSA requires your exported results to be reviewed before download, your request will be processed by our Safe Output Service. You will receive an email when your request has been processed.

Your request may be rejected if it does not meet our disclosure control guidance. If your results do not meet our disclosure control rules, we will contact you to explain the reasons why your results could not be approved.

To export your results, you must follow the Output your results guidance.


Exporting results to CSV

If your export request needs to be reviewed before download, you must ensure that you use clear descriptors for the column names, or your download may be rejected.

To create a CSV file:

1. Run the code to create your output.

Databricks will display the first 1,000 rows of data by default.

2. Click on the down arrow to the right of Table.

If you have a small number of rows, you will see the option to download all results.

If you have a large number of rows, you will see two options to download first ‘X’ number of rows or download all rows.

download screen

The exported CSV file will be displayed at the bottom of your screen. The file will be named ‘export.CSV’.

3. Click on the arrow next to the CSV file and select Show in folder from the drop-down menu.

show in folder screen

The exported file will download to the Downloads folder on your virtual desktop.

We recommend that you rename the ‘export.CSV’ file with a descriptive name, for example, ‘diagnosis_by_hospital_by_month.CSV’, to enable a swift review of your export.

If you are required to submit your results through our Output service, you will need to follow the Output your Results guidance.


Exporting graphs as PNG

You can export graphs in Python notebooks as a PNG file, including graphs created using Matplotlib.

If your export request needs to be reviewed before download, you must clearly label the axis names and title of your graph or your download may be rejected.

To create a PNG file:

  1. Run your SQL code or use "display(...)" on a spark dataframe or matplotlib figure.
  2. Press the + button and select the visualization to design your plot.
  3. Hover your mouse over the right-hand side of plot diagram.
  4. Click on the Download plot as a PNG icon.

download plot as a png

The exported PNG file will be displayed at the bottom of your screen. The file will be named ‘newplot.png’.

5.  Click on the arrow next to the PNG file and select Show in folder from the drop-down menu.

show in folder

The exported file will download to the Downloads folder on your virtual desktop.

We recommend that you rename the ‘newplot.PNG’ file with a descriptive name, for example, ‘diagnosis_by_team_by_age.PNG’, to enable a swift review of your export.

If you are required to submit your results through our Output service, you will need to follow the Output your Results guidance.


Exporting a Python file

Exporting your results as a Python file will allow you to include comments in your output. This will provide more information for the Safe Output Service team and help ensure that your download is processed swiftly and in line with disclosure control rules.

The exported file will only contain raw text. Graphs will not be included.

To create a Python file:

  1. Add a comment above the results to describe what the code does.
  2. Run your notebook.
  3. Select File > Export > Source File.

exporting a python file

The exported Python file will be displayed at the bottom of your screen. The file will have the same name as the notebook.

4. Click on the arrow next to the Python file and select Show in folder from the drop-down menu.

show in folder

The exported file will download to the Downloads folder on your virtual desktop.

We recommend that you rename the Python file with a descriptive name to enable a swift review of your export.

If you are required to submit your results through our Output service, you will need to follow the Output your Results guidance.


Data awareness training

The Safe Data Access Professionals Group helps share expertise, best practice and knowledge between organisations engaged in providing secure access to confidential sources of data from the health and social science research sector.

These free data awareness training courses and modules provide you with best practice information on working with statistical data and can be accessed on the Secure Data Group website.


Last edited: 22 July 2024 3:21 pm