Skip to content

Commit 2b0ff88

Browse files
feat: parse_complex_excel_sheets - Parse complex Excel Sheets using pandas and xlrd
1 parent 652b6f7 commit 2b0ff88

File tree

5 files changed

+79
-56
lines changed

5 files changed

+79
-56
lines changed

third_party/Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ prettytable = "*"
3737
fs = "*"
3838
pytest = "*"
3939
requests = "*"
40+
xlrd = "*"
4041

4142
[dev-packages]
4243

third_party/Pipfile.lock

Lines changed: 65 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third_party/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ A collection of useful snippets using third party packages.
2727
| mocking_requests | Mocking the entire `requests` library and check for correct response handling |
2828
| mypy_example | Example on how to use Pythons type hints and mypy |
2929
| numpy_array_operations | Reveiling the behaviour of simply array operations using NumPy |
30-
| reduce_pandas_df_memory | Reduce pandas df memory usage by converting `object` to `category` |
30+
| parse_complex_excel_sheets | Parse complex Excel Sheets using `pandas` and `xlrd` |
3131
| port_scanner_nmap | Port Scanner using nmap |
3232
| pytest_rename_class_backwards_compatibility | Rename a critical class and test for backwards compatibility |
33+
| reduce_pandas_df_memory | Reduce pandas df memory usage by converting `object` to `category` |
3334
| refactoring_code | Refactoring Python code using rope |
3435
| resize_images | Resize all images in the current directory using OpenCV |
3536
| show_progress | Shows the progress using progressbar |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from pathlib import Path
2+
3+
import pandas as pd
4+
5+
6+
path = Path("src/samples.xlsx")
7+
xls = pd.ExcelFile(path)
8+
print(xls.sheet_names)
9+
10+
df = xls.parse(xls.sheet_names[0])
11+
print(df.head())

third_party/src/samples.xlsx

9.74 KB
Binary file not shown.

0 commit comments

Comments
 (0)