## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• 18:28
• 18:25
• 18:15
simonjayhawkins labeled #41001
• 18:15
simonjayhawkins opened #41001
• 18:15
simonjayhawkins milestoned #41001
• 17:44
jakehsiao commented #40966
• 15:30
DriesSchaumont commented #33634
• 15:29
topper-123 demilestoned #40995
• 15:29
topper-123 milestoned #40995
• 15:29
topper-123 milestoned #40995
• 15:29
topper-123 labeled #40995
• 15:28
topper-123 labeled #40995
• 15:23
DriesSchaumont commented #33634
• 14:48
jbrockmendel opened #41000
• 14:43
phofl labeled #40999
• 14:43
phofl labeled #40999
• 14:43
phofl opened #40999
• 13:59
phofl edited #40993
• 12:01
• 12:00
PatrykJacak
@PatrykJacak
I will try
PatrykJacak
@PatrykJacak
It works :) thank you
matrixbot
@matrixbot

Florian Hi there, can anyone help me with a seamingly simple task?

I have the following DataFrame:

   Participant  Time  Value
0            1     1      1
1            1     2      2
2            1     3      3
3            2     1      2
4            2     2      5
5            2     3      7

And now I want to subtract the Value at Time==1 from the Value at Time==2 and Time==3, such that the DataFrame becomes:

   Participant  Time  Value
0            1     1      0
1            1     2      1
2            1     3      2
3            2     1      0
4            2     2      3
5            2     3      5

I just cannot figure out how to do this :-)

matrixbot
@matrixbot

kir0ul > <@fladd:matrix.org> Hi there, can anyone help me with a seamingly simple task?

I have the following DataFrame:

   Participant  Time  Value
0            1     1      1
1            1     2      2
2            1     3      3
3            2     1      2
4            2     2      5
5            2     3      7

And now I want to subtract the Value at Time==1 from the Value at Time==2 and Time==3, such that the DataFrame becomes:

   Participant  Time  Value
0            1     1      0
1            1     2      1
2            1     3      2
3            2     1      0
4            2     2      3
5            2     3      5

I just cannot figure out how to do this :-)

matrixbot
@matrixbot

Florian kir0ul: Thanks for the pointer. However, this does not seem to work. I do:

for i in range(1, len(data)):
time = data.loc[i, "Time"]
if time != 1:
data.loc[i, "Time"] = data.loc[i, "Time"] - data.loc[i-time-1, "Time"]

But I get the error:

KeyError: 'the label [-2] is not in the [index]'
Florian ha, paranthesis error :-)
Florian but it still does not work. I creates the original data frame, instead of the subtracted one
matrixbot
@matrixbot
Florian got it to work now. Thanks!
Marc Garcia
@datapythonista
@WillAyd regarding the stale bot, this should be quite simple to implement with GitHub actions directly in the CI (see https://github.com/actions/stale). This is still beta, but when it's released, I see an advantage having it set up in a yaml in the repository, compared to having to integrate another third-party service.
I'm neutral on whether this is a good idea or not, I'd say that if there is interest, we can give it a try, and if it becomes annoying we remove it
Joris Van den Bossche
@jorisvandenbossche
@jreback @TomAugspurger @jbrockmendel now or in 2.5 hours?
Tom Augspurger
@TomAugspurger
I think now
Joris Van den Bossche
@jorisvandenbossche
Jeff just sent a mail to ask in two hours
Tom Augspurger
@TomAugspurger
Joris Van den Bossche
@jorisvandenbossche
as I said originally, for me either now or in 2.5 hours, but both are fine
Jeff Reback
@jreback
if u don’t mind can we reschedule for 2 (or 2.5) hours
Tom Augspurger
@TomAugspurger
@jreback we had the call. Notes at https://docs.google.com/document/d/1k_E_1oSV9VNHgGzepdeCyFdju8ZaXDwI3CvDYkhOtQ8/edit?usp=sharing. Summary at the bottom is where I’d recommend focusing.
Jeff Reback
@jreback
onboard with the summary - i’d say go ahead with a PR
William Ayd
@WillAyd
@datapythonista cool thanks for the info. I am also on board with maybe try and if we don’t like can always revert
Where in what you showed me did you see the info around a stable release?
Marc Garcia
@datapythonista
GitHub actions itself is in beta, not sure when it'll be stable: https://github.com/features/actions
sabquat
@sabquat
I am having trouble with scatter plot. I have posted my problem in Stack Overflow-
https://stackoverflow.com/q/57988832/3862410
I need some hints on my mistake
I am not sure, if this is my mistake or some kind of bug
Chris
@0x5f3759df_gitlab
hi there.
i want to store a class or @dataclass as the values for one of my dataframe columns
i was just wondering if you can access member functions or attributes particularly like when you do the df filtering
like df[df['MYCLASSCOL'].attribute == 'helloworld']]
or df[df['MYCLASSCOL'].someBoolMethod(1,2,3)]
killerontherun1
@killerontherun1
When parsing a dictionary containing a list of datetime objects, pandas converts it to numpy.datetime64. Is this normal? Reproducable example:
>>>  from pandas import DataFrame as df
>>>  import datetime
>>>  inp = {'date':[datetime.datetime.now() for val in range(3)]}
>>>  inp_tbl = df(inp)
>>>  inp_tbl
date
0  2019-09-20 15:00:35.080488
1  2019-09-20 15:00:35.080525
2  2019-09-20 15:00:35.080527
>>>  inp_tbl.dtypes
date    datetime64[ns]
dtype: object
>>>  inp_tbl['date'].values[0]
numpy.datetime64('2019-09-20T15:00:35.080488000')
Felipe Catão do Nascimento
@FelipeKatao
Please, who can follow me in GitHub? I write one project in Python one new framework, and this project and my profile need plus one follow, for I can participate one conpetition, who could help , I thanks : https://github.com/FelipeKatao
Ian Horsman
@Ianphorsman
Hey guys, I'm interested in contributing to pandas. I have a lot of experience in python. I've used pandas on a few projects, and I'd be interested to spend some of my free time helping it grow whether that's committing to first-timer issues or developing new features. If someone who is an active contributor would like to help me get started, or even provide some mentorship I would appreciated the opportunity.
William Ayd
@WillAyd
Hi @Ianphorsman - that’s great. If looking to contribute we have quite a few things labeled “good first issue” on GitHub. I’d suggest finding one that may interest you and working from there
Marc Garcia
@datapythonista
@Ianphorsman I'd suggest having a look at this issue: pandas-dev/pandas#27977, and fixing few of the problems mentioned there, to get familiarity with the project in a simple way
feel free to DM after that, and I'll try to give you advice on what else you could work on, based on your interests
Tom Augspurger
@TomAugspurger
This message was deleted
William Ayd
@WillAyd
Does anyone know what our requirements are off hand to add a method to an accessor?
Specifically looking at the .dt accessor I thought it might be driven by some of the delegate decorators and class variables like _datetimelike_methods
But I see stuff exposed to the accessor that don’t appear in those variables (ex: to_pydatetime for a DTA)
Tom Augspurger
@TomAugspurger
I think you’re correct about that. It’s on DatetimeProperties, TimedeltaProperties, etc.
That class also defines a to_pydatetime. But the majority come from _datetimelike_methods I think
William Ayd
@WillAyd
OK cool
Yea just not sure what makes a method like to_pydatetime appear but not to_perioddelta
Will keep digging though; sounds like I’m in the ballpark
Thanks @TomAugspurger
Tom Augspurger
@TomAugspurger
I don’t think to_perioddelta is in DatetimeArray._datetimelike_methods
William Ayd
@WillAyd
Yea
Neither is to_pydatetime
So I think there’s just some more logic than looking at that variable
Phaneendra
@PhaneendraGunda