Skip to content

basic operators added as well as some basic functions#29

Merged
wadetb merged 6 commits intowadetb:masterfrom
Kramer84:master
Jul 20, 2020
Merged

basic operators added as well as some basic functions#29
wadetb merged 6 commits intowadetb:masterfrom
Kramer84:master

Conversation

@Kramer84
Copy link
Copy Markdown
Contributor

@Kramer84 Kramer84 commented Jul 15, 2020

Hello, I have done some updates on your code.

Added some basic mathematical operators (normal and in place) for:

  • summation
  • subtraction
  • division/ truedivision/ floor
  • mod
  • power

Added two basic functions to ndarray:

  • tolist():
    to convert the ndarray into a comprehensive list
  • argwhere()
    to return a list of keys, where the value of the ndarray match an other given value

Modified the init() method so it accepts also lists as a shape.
Added the nan object (to be able to use np.nan).
Added the reshape function (not only as an method of the ndarray class)

The code is not entirely tested but should work.

I needed these functions in my project and had to work only with a basic python install using the standard library.

Thanks for the having made this project!

@wadetb
Copy link
Copy Markdown
Owner

wadetb commented Jul 20, 2020

Thanks for these changes, glad to hear the project was helpful.

@wadetb
Copy link
Copy Markdown
Owner

wadetb commented Jul 20, 2020

Can you restore the docs directory that was deleted, and also run pytest (may have to install it via pip) and ensure it succeeds?

@Kramer84
Copy link
Copy Markdown
Contributor Author

The docs are restored and the tinyndarray tests passed. The tests for the tinynumpy script also pass, but only when numpy is not installed, but I suppose this is expected behavior.

@wadetb wadetb merged commit e6aca72 into wadetb:master Jul 20, 2020
@wadetb
Copy link
Copy Markdown
Owner

wadetb commented Jul 20, 2020

Excellent, thank you!

@ben-z ben-z mentioned this pull request Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants