File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/atomistics/referencedata Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1+ from io import StringIO
2+
13import pandas
24import requests
35
@@ -33,7 +35,7 @@ def get_elastic_properties(chemical_symbol: str) -> dict:
3335 "https://en.wikipedia.org/wiki/Elastic_properties_of_the_elements_(data_page)" ,
3436 headers = {"User-Agent" : "atomistics package" },
3537 )
36- df_lst = pandas .read_html (response .text )
38+ df_lst = pandas .read_html (StringIO ( response .text ) )
3739 property_dict = {}
3840 for i , p in enumerate (property_lst ):
3941 df_tmp = df_lst [i ]
Original file line number Diff line number Diff line change 11import os
2+ from io import StringIO
23from typing import Callable , Optional , Union
34
45import numpy as np
@@ -17,7 +18,7 @@ def _get_content_from_url(url: str) -> pandas.DataFrame:
1718 Returns:
1819 pandas.DataFrame: The content retrieved from the URL as a pandas DataFrame.
1920 """
20- content = pandas .read_html (requests .get (url ).text )
21+ content = pandas .read_html (StringIO ( requests .get (url ).text ) )
2122 if len (content [8 ]) > 1 :
2223 return content [8 ]
2324 else :
You can’t perform that action at this time.
0 commit comments