Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 16 17:29

    thomkeh on thomkeh-patch-1

    (compare)

  • Feb 16 17:29

    thomkeh on master

    Update README.md Merge pull request #229 from pr… (compare)

  • Feb 16 17:29
    thomkeh closed #229
  • Feb 16 17:23
    thomkeh review_requested #229
  • Feb 16 17:23
    thomkeh review_requested #229
  • Feb 16 17:23
    thomkeh opened #229
  • Feb 16 17:22

    thomkeh on thomkeh-patch-1

    Update README.md (compare)

  • Feb 16 16:53

    thomkeh on readme-maintainer-alert

    (compare)

  • Feb 16 16:53

    thomkeh on master

    Update readme Merge pull request #228 from pr… (compare)

  • Feb 16 16:53
    thomkeh closed #228
  • Feb 16 16:52
    thomkeh opened #228
  • Feb 16 16:52

    thomkeh on readme-maintainer-alert

    Update readme (compare)

  • Feb 16 16:44

    thomkeh on v0.2.23

    (compare)

  • Feb 16 16:44

    thomkeh on release

    Add Series.sort_index() signatu… Add missing Series.sort_values(… Fix SyntaxError adding default … and 26 more (compare)

  • Feb 10 18:03
    listout closed #226
  • Feb 08 10:39
    uihsnv edited #227
  • Feb 08 10:39
    uihsnv opened #227
  • Feb 07 14:20
    listout opened #226
  • Feb 01 14:48
    jgonsior opened #225
  • Feb 01 14:48
    jgonsior edited #224
Sameroom
@sameroom-bot
[Thomas Kehrenberg, Data Science] ok, it works
Myles Bartlett
@MylesBartlett
hello gitter
indeed it does
I'm rather impressed
Oliver Thomas
@olliethomas
:wave:
Sameroom
@sameroom-bot
[Myles Bartlett, Data Science] :wave:
Oliver Thomas
@olliethomas
@MylesBartlett how's #143 coming along?
thomkeh
@thomkeh
shouldn't you ask me?
Oliver Thomas
@olliethomas
I thought myles said he was going to redo it
as he didn't like the dotted paper
thomkeh
@thomkeh
oh. he's very welcome to
Sameroom
@sameroom-bot
[Myles Bartlett, Data Science] the dotted paper?
thomkeh
@thomkeh
maybe have a look at what #143 is
Sameroom
@sameroom-bot
[Myles Bartlett, Data Science] I am doing that now
Sameroom
@sameroom-bot
[Myles Bartlett, Data Science] oh yes
[Myles Bartlett, Data Science] the logo is hideous
Sameroom
@sameroom-bot
[Oliver Thomas, Data Science] /github subscribe predictive-analytics-lab/data-science-types
[Unknown, Data Science]
Subscribed to predictive-analytics-lab/data-science-types
[Unknown, Data Science]
Pull request closed by thomkeh
predictive-analytics-lab/data-science-types#143
[Unknown, Data Science]
Pull request reopened by thomkeh
predictive-analytics-lab/data-science-types#143
[Oliver Thomas, Data Science] /github close predictive-analytics-lab/data-science-types#142

[Unknown, Data Science]
Issue closed by olliethomas
predictive-analytics-lab/data-science-types#142

[Unknown, Data Science]
Issue closed by olliethomas
predictive-analytics-lab/data-science-types#142

[Unknown, Data Science]
Issue reopened by olliethomas
predictive-analytics-lab/data-science-types#142
Sameroom
@sameroom-bot
[Thomas Kehrenberg, Data Science] poor issue 142
Sameroom
@sameroom-bot
[Unknown, Data Science]
Issue opened by adimyth
predictive-analytics-lab/data-science-types#175
I forked the repo and ran the tests - ./check_all.sh, it resulted in 152 errors found in 4 files. How to get started?
[Oliver Thomas, Data Science] I guess this is import pytest in the tests leading mypy on a merry dance again
[Thomas Kehrenberg, Data Science] oh no
Sameroom
@sameroom-bot

[Unknown, Data Science]
Pull request opened by adimyth
predictive-analytics-lab/data-science-types#176
Added validation for the following set of string methods -

• count
• endswith
• find
• findall
• get
• index
• join
• len
• ljust
• lower
• lstrip
• match
• pad
• repeat
• rfind
• rindex
• rjust
• rstrip
• slice
• slice_replace
• split
• rsplit
• startswith
• strip
• translate
• wrap
• zfill
• get_dummies

Sameroom
@sameroom-bot

[Unknown, Data Science]
Issue opened by LukasSalchow
predictive-analytics-lab/data-science-types#177
Hi,
in my opinion it's universally considered a best practice/pythonic to safe memory using a generator rather than a list e.g. when concatenating dataframes. Sadly for now that raises an exception in mypy since concat only excepts Union[Sequence[DataFrame], Mapping[str, DataFrame]]. Notice that generators are not considered sequences.

I would very much appreciate it if somebody could add iterables to the accepted input types of pandas.concat.

Thank you for your time.

Sameroom
@sameroom-bot

[Thomas Kehrenberg, Data Science] > I guess this is import pytest in the tests leading mypy on a merry dance again

We really have to remove that import

[Thomas Kehrenberg, Data Science] It's only there because of approx I think
[Thomas Kehrenberg, Data Science] That can be done another way
thomkeh
@thomkeh
I wonder what the matrix people will do with gitter
Oliver Thomas
@olliethomas
make it available as a paid-for plugin on GitHub
thomkeh
@thomkeh
I don't think so
Matrix is all about open source
gosh, this bot is annoying
I'll turn it off
Avraam Marimpis
@makism
hey guys, first of all, thank you for your amazing work.
1 reply
while the types/stubs work perfectly with mypy; pytest/nosetests complain with something along the lines:
x: np.ndarray[np.float32]
TypeError: 'type' object is not subscriptable
7 replies
are there any special settings/something required when doing testing? :S
Oliver Thomas
@olliethomas
We really need to turn this bot off
@thomkeh :eyes:
thomkeh
@thomkeh
bot has been removed!
Oliver Thomas
@olliethomas
🙌
thomkeh
@thomkeh

@makism if you want to have the full explanation: np.ndarray[np.float32] will fail any time it is evaluated by python. this is because the actual class np.ndarray is not subscriptable. (np.ndarray objects are of course subscriptable, but not the class itself.) in our type stubs we pretend like the class is subscriptable, but this is just something our type stubs pretend; in reality, np.ndarray is not subscriptable.
ok, so that brings us to the question of why this fails:

def f(x: np.ndarray[np.float32]):
    return x

but this succeeds:

def f():
    x: np.ndarray[np.float32] = np.ones(10)

The reason is that when python parses your code, it evaluates all type annotations that are on the top level. The annotations of top-level functions count as such. Annotations within a function are not evaluated.
So, how to prevent python from evaluating the type annotations of functions? The first option is to wrap them into quotes: "np.ndarray[np.float32]". This works on Python 3.5+. The other option is to use from __future__ import annotations, which disables the evaluation of type annotations in the whole file. But this is only available starting with Python 3.7.

(the annotations of variables that are not in a function (i.e., "global" variables) are also by default evaluated by python)
Avraam Marimpis
@makism
@thomkeh, wow, thank you for the detailed explanation!