Skip to content

Commit

Permalink
Updated df.applymap to df.map to silence FutureWarning (#42)
Browse files Browse the repository at this point in the history
* Updated df.applymap to df.map to silence FutureWarning

* updated dependencies

* drop 3.8 testing

---------

Co-authored-by: Alister Burt <[email protected]>
  • Loading branch information
ray-berkeley and alisterburt authored Jan 15, 2024
1 parent 9f3fe21 commit 5d93598
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
platform: [ ubuntu-latest ]
python-version: [ "3.8", "3.9", "3.10" , "3.11"]
python-version: ["3.9", "3.10" , "3.11"]

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ classifiers =
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Expand All @@ -23,11 +22,11 @@ classifiers =
[options]
zip_safe = False
packages = find:
python_requires = >= 3.8
python_requires = >= 3.9
include_package_data = True
install_requires =
numpy
pandas
pandas>=2.1.1
typing-extensions


Expand Down
6 changes: 3 additions & 3 deletions starfile/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def write_loop_block(
f.write('\n'.join(header_lines))
f.write('\n')

df = df.applymap(lambda x: f'{quote_character}{x}{quote_character}'
if isinstance(x, str) and (quote_all_strings or " " in x or x == "")
else x)
df = df.map(lambda x: f'{quote_character}{x}{quote_character}'
if isinstance(x, str) and (quote_all_strings or " " in x or x == "")
else x)

# write data
df.to_csv(
Expand Down

0 comments on commit 5d93598

Please sign in to comment.