Skip to content

Commit adfeb24

Browse files
authored
Update README.md
1 parent d770f41 commit adfeb24

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ pip install ztree2python
1515
Alternatively, simply put ztree2python.py and a z-Tree data file (e.g., 221215_1449.xls) in the current directory or the working directory.
1616

1717
## Usage
18-
The ztree2python is a simple function that takes the filename of a z-Tree data file as the argument and returns a dictionary that contains all of the tables in the z-Tree.
18+
The ztree2python is a simple function that takes the filename of a z-Tree data file as the argument and returns a dictionary that contains all of the tables in the z-Tree data file.
1919
```python
20-
from ztree2python import ztree2python as ztree2python
20+
from ztree2python import ztree2python as z2p
2121

2222
# input the file name, and it returns a dictionary.
23-
tables = ztree2python('221215_1449.xls')
23+
tables = z2p('221215_1449.xls')
2424
```
2525
The function returns a dictionary. Each table is stored as a dataframe in the ```tables```. Get the data of a table as follows:
2626
```python
@@ -39,19 +39,27 @@ for name, tbl in tables.items():
3939
display(tbl)
4040
```
4141

42+
## Technical notes
43+
44+
The function reads the data and iterates the following process over the names of the tables. It filters the rows of the main dataframe to only include rows that belong to the current table. Then it processes the data for each treatment within the table and creates a dataframe for each treatment.
45+
If the period is repeated in the treatment, the data for the treatment has a header row with variable names inserted each period. This function assumes that these header rows are the same within the treatment and reads the top header row as the variable names, then removes all header rows afterwards. All data will be converted to numeric, if possible. Finally, the table for the current treatment is added to the dataframe for the current table.
46+
47+
After all the tables have been processed, the function returns the dictionary of dataframes.
48+
4249
## License
4350

44-
[MIT](https://choosealicense.com/licenses/mit/)
51+
[MIT](https://choosealicense.com/licenses/mit/). ztree2python is "provided "as is", without warranty of any kind."
4552

4653
## Reference
4754
Fischbacher, U. (2007). z-Tree: Zurich toolbox for ready-made economic experiments. *Experimental Economics*, 10(2), 171-178.
4855
https://doi.org/10.1007/s10683-006-9159-4.
4956

57+
Takeuchi, Kan. (2022). ztree2python.py, http://github.com/takekan/ztree2python.
58+
5059
Takeuchi, K. (2022). ztree2stata: A data converter for z-Tree and Stata users. (*Journal of the Economic Science Association*, R&R.)
5160

5261
I would appreciate it if you kindly mention to this code in a footnote or somewhere.
5362

54-
Takeuchi, Kan. (2022). ztree2python.py, http://github.com/takekan/ztree2python.
5563

5664

5765
## Acknowledgment

0 commit comments

Comments
 (0)