Skip to content

Commit

Permalink
fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
PointlessUser committed Aug 11, 2023
1 parent 1e022d5 commit 9e66150
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ Create a DataFrame from given rows and column headers
| -------------------- | ------------------- | ------------------------------------------------------------------------------- |
| **`column_headers`** | **List[str]** | List of column headers |
| **`rows`** | **List[List[str]]** | List of rows to be converted into a DataFrame. Each column is a list of strings |
| **`index`** | **bool** (optional) | Whether to use the first column as the DataFrame's index. (Defaults to True) |

#### Returns:

Expand Down
6 changes: 3 additions & 3 deletions mecsimcalc/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ def print_image(
)

# Convert Display image to HTML
image = f"<img src='{encoded_display_data}'>"
image_tag = f"<img src='{encoded_display_data}'>"

if not download:
return image
return image_tag

# Convert full resolution image to an HTML download link
download_link = f"<a href='{encoded_data}' download='{download_file_name}.{image.format}'>{download_text}</a>"

return image, download_link
return image_tag, download_link
6 changes: 2 additions & 4 deletions mecsimcalc/table_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def table_to_dataframe(
column_headers: List[str], rows: List[List[str]], index: bool = True
column_headers: List[str], rows: List[List[str]]
) -> pd.DataFrame:
"""
>>> table_to_dataframe(column_headers: List[str], rows: List[List[str]]) -> pd.DataFrame
Expand All @@ -16,8 +16,6 @@ def table_to_dataframe(
List of column headers.
rows : List[List[str]]
List of rows to be converted into a DataFrame. Each row is a list of strings.
index : bool
Whether to use the first column as the DataFrame's index. (Defaults to True)
# Raises
Expand All @@ -43,7 +41,7 @@ def table_to_dataframe(
if len(row) != len(column_headers):
raise ValueError("Each row must have the same length as the column headers")

return pd.DataFrame(rows, columns=column_headers, index=index)
return pd.DataFrame(rows, columns=column_headers)


def print_table(
Expand Down

0 comments on commit 9e66150

Please sign in to comment.