Skip to content

Remove parent directories in python build source archive

I have the following setup for my python package: The __init__.py is empty, the pyproject.toml and the setup.cfg contain example output from the PyPi documentation page (content shown below). Now, for uploading to PyPi and for packing the python project, I run the command This gives me a new directory dist (i…

Pooling for 1D tensor

I am looking for a way to reduce the length of a 1D tensor by applying a pooling operation. How can I do it? If I apply MaxPool1d, I get the error max_pool1d() input tensor must have 2 or 3 dimensions but got 1. Here is my code: Answer Your initialization is fine, you’ve defined the first two parameters…

Including specific strings in missing values count

I need to determine the percentage of missing and not available values. I have approx. 30 columns and data for missing are NA, ‘Information not found’ (string), and ‘Data not available’ (string). For determining the pct of missing (NA) values, I am using the following: How can I includ…