**headings* is a dictionary of lists. Each list has the header names of the corresponding *GROUP*
>>>
**Important:** If the above code throws an exception or returns an empty dictionary, it very likely that the input file is not a valid AGS4 file. In such a case, the `AGS4.check_file()` function can be used to validate the file and see whether anything needs to be fixed before trying again. Most users will find it easier perform this step using the [command line interface](#command-line-interface) as it will provide a formatted error report that is much easier to read than the python dictionary created by directly calling the function.
**Important:** If the above code throws an exception or returns an empty dictionary, it very likely that the input file is not a valid AGS4 file. In such a case, the `AGS4.check_file()` function can be used to validate the file and see whether anything needs to be fixed before trying again. Most users will find it easier to perform this step using the [command line interface](#command-line-interface) as it will provide a formatted error report that is much easier to read than the python dictionary created by directly calling the function.
>>>
All data are imported as text so they cannot be analyzed or plotted immediately. You can use the following code to convert all the numerical data in a DataFrame from text to numeric.
@@ -70,7 +70,7 @@ All data are imported as text so they cannot be analyzed or plotted immediately.
LOCA=AGS4.convert_to_numeric(tables['LOCA'])
```
The `AGS4.convert_to_numeric()` function automatically converts all columns in the input DataFrame with the a numeric *TYPE* to a float. (*Note: The UNIT and TYPE rows are removed during this operation as they are non-numeric.*)
The `AGS4.convert_to_numeric()` function automatically converts all columns in the input DataFrame with a numeric *TYPE* to a float. (*Note: The UNIT and TYPE rows are removed during this operation as they are non-numeric.*)
#### Export data back to an AGS4 file
@@ -83,11 +83,11 @@ A DataFrame with numeric columns may not get exported with the correct precision
LOCA_txt=AGS4.convert_to_text(LOCA,'DICT.ags')
```
Tables converted to numeric using the ```AGS4.convert_to_numeric()``` function should always be converted back to text before exporting to an AGS4 file. (*Note: The UNIT and TYPE rows will be added back in addition to formatting the numeric columns.*)
Tables converted to numeric using the ```AGS4.convert_to_numeric()``` function should **always** be converted back to text before exporting to an AGS4 file. (*Note: The UNIT and TYPE rows will be added back in addition to formatting the numeric columns.*)
### Juypter Notebook
### Jupyter Notebook
We have created an example Juypter Notebook which imports an AGS file, plots boreholes on a map and creates a Striplog.
We have created an example Jupyter Notebook which imports an AGS file, plots boreholes on a map and creates a Striplog.
@@ -107,7 +107,7 @@ A checking tool is available as of version 0.3.0 and it can be used to make sure
### Graphical User Interface using *pandasgui*
The output from `python-ags4` can be directly used with [`pandasgui`](https://github.com/adamerose/pandasgui) to view and edit AGS4 files using an interactive graphical user interface. It also provides funtionality to plot and visualize the data.
The output from `python-ags4` can be directly used with [`pandasgui`](https://github.com/adamerose/pandasgui) to view and edit AGS4 files using an interactive graphical user interface. It also provides functionality to plot and visualize the data.
If the above code throws an exception or returns an empty dictionary, it very likely that the input file is not a valid AGS4 file. In such a case, the `AGS4.check_file()` function can be used to validate the file and see whether anything needs to be fixed before trying again. Most users will find it easier perform this step using the [command line interface](#command-line-interface) as it will provide a formatted error report that is much easier to read than the python dictionary created by directly calling the function.
If the above code throws an exception or returns an empty dictionary, it very likely that the input file is not a valid AGS4 file. In such a case, the `AGS4.check_file()` function can be used to validate the file and see whether anything needs to be fixed before trying again. Most users will find it easier to perform this step using the [command line interface](#command-line-interface) as it will provide a formatted error report that is much easier to read than the python dictionary created by directly calling the function.
All data are imported as text so they cannot be analyzed or plotted immediately. You can use the following code to convert all the numerical data in a DataFrame from text to numeric.
@@ -64,7 +64,7 @@ All data are imported as text so they cannot be analyzed or plotted immediately.
LOCA=AGS4.convert_to_numeric(tables['LOCA'])
```
The `AGS4.convert_to_numeric()` function automatically converts all columns in the input DataFrame with the a numeric *TYPE* to a float. (*Note: The UNIT and TYPE rows are removed during this operation as they are non-numeric.*)
The `AGS4.convert_to_numeric()` function automatically converts all columns in the input DataFrame with a numeric *TYPE* to a float. (*Note: The UNIT and TYPE rows are removed during this operation as they are non-numeric.*)
Tables converted to numeric using the ```AGS4.convert_to_numeric()``` function should always be converted back to text before exporting to an AGS4 file. (*Note: The UNIT and TYPE rows will be added back in addition to formatting the numeric columns.*)
### Juypter Notebook
### Jupyter Notebook
We have created an example Juypter Notebook which imports an AGS file, plots boreholes on a map and creates a Striplog.
We have created an example Jupyter Notebook which imports an AGS file, plots boreholes on a map and creates a Striplog.
@@ -103,7 +103,7 @@ A checking tool is available as of version 0.3.0 and it can be used to make sure
### Graphical User Interface using *pandasgui*
The output from `python-ags4` can be directly used with [`pandasgui`](https://github.com/adamerose/pandasgui) to view and edit AGS4 files using an interactive graphical user interface. It also provides funtionality to plot and visualize the data.
The output from `python-ags4` can be directly used with [`pandasgui`](https://github.com/adamerose/pandasgui) to view and edit AGS4 files using an interactive graphical user interface. It also provides functionality to plot and visualize the data.