Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:08
    jbrockmendel edited #6581
  • 18:08
    jbrockmendel edited #13777
  • 17:54
    SaturnFromTitan commented #29405
  • 17:53
    tlaytongoogle review_requested #29134
  • 17:46
    jbrockmendel commented #30083
  • 17:46

    jorisvandenbossche on master

    CI: correct azure-36-locale slo… (compare)

  • 17:43
    jorisvandenbossche closed #30065
  • 17:43
    jorisvandenbossche commented #30065
  • 17:42
    jorisvandenbossche labeled #30081
  • 17:40
    jorisvandenbossche commented #30082
  • 17:39
    jorisvandenbossche milestoned #30063
  • 17:39
    jorisvandenbossche labeled #30063
  • 17:28
    jbrockmendel edited #30082
  • 17:28
    jbrockmendel commented #30082
  • 17:27
    jbrockmendel commented #30077
  • 17:22
    jorisvandenbossche commented #30082
  • 17:21
    jbrockmendel commented #29547
  • 17:15
    jbrockmendel opened #30085
  • 17:12
    jbrockmendel opened #30084
  • 17:05
    jbrockmendel commented #30067
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
While uploading CSV file to Google drive, it automatically converting to Google Sheets. How to save it as CSV file in drive? or can I read google sheet through pandas data frame in Google Colab?
andymcarter
@andymcarter
Trying to replicate some Excel conditional formatting in pandas. I have used the .background_gradient method, but I would like to replicate the Excel three-colour formatting where you have two colour scales (one +ve and one -ve) and you define the centre value (e.g. 0).
Anyone achieved anything similar? Essentially a 3 colour diverging map where you specify the value for the centre colour.
Josiah Baker
@josibake
hey all, been working on pandas-dev/pandas#27977 as a first time contributor. first off, super excited to get involved. i have two pull requests open and was curious if there is a formal process for requesting a review? thanks!
William Ayd
@WillAyd
No formal request process - someone will review as they come across
I’ll try to take a look later today if no one else gets to it in the meantime
Josiah Baker
@josibake
@WillAyd awesome, good to know! and thanks
Joshua Wilson
@jwilson8767
Hi, I've been using Pandas (and GeoPandas) for several years and just now realized how many open issues (3000+) and PRs (~150) there are! Is there a roadmap / master plan somewhere? Does the project just move slow/carefully, or are y'all drowning in more work than you can handle?
Marc Garcia
@datapythonista
@jwilson8767 we're all volunteers, surely doing more than we can, and help always welcome. The project is big and stable enough to move slowly, and you have the roadmap here: https://pandas.pydata.org/pandas-docs/stable/development/roadmap.html
Joshua Wilson
@jwilson8767
Thanks!
Irv Lustig
@Dr-Irv
@andymcarter Use xlsxwriter to do the conditional formatting. More info here: https://xlsxwriter.readthedocs.io/working_with_conditional_formats.html
Thomas Havlik
@thavlik
Hey folks! When using either df.drop(df.index[i], inplace=True) or df = pd.concat([df[:i], df[i+1:]]), some cells become NaN
df.isna()['Timestamp'].sum() == 0 until I try and remove rows from df. At some point, df.at[i+1, 'Timestamp'] becomes nan. The loop for this is range(0, len(df)-1)
i.e. df.at[i+1, :] is always accessible
start, repeat = (0, True)
initial_rows = len(df)
num_dupes = 0
while repeat:
    repeat = False
    for i in range(0, len(df)-1):
        c = df.iloc[i]
        n = df.iloc[i+1]
        ct = int(c['Timestamp'])
        nt = int(n['Timestamp'])
        diff = nt - ct
        if diff < dupe_threshold:
            # remove the latter sample, logically ORing
            # this sample with it before removal
            if bool(n['Label']):
                df.at[i, 'Label'] = True
            # this doesnt work
            #df.drop(df.index[i+1], inplace=True)

            # neither did this
            #indexes_to_drop = set([i+1])
            #indexes_to_keep = set(range(df.shape[0])) - indexes_to_drop
            #df = df.take(list(indexes_to_keep))

            # and this didnt either
            df = pd.concat([df[:i], df[i+1:]])

            start, repeat = (i, True)
            num_dupes += 1
            total_num_dupes += 1
            break
nt = int(n['Timestamp']) throws "cannot convert nan to int"
Thomas Havlik
@thavlik
I think when I am setting the value with df.at[i, 'Label'] = True, I am losing those rows' data
Thomas Havlik
@thavlik
This is nonsense. Why is it that df.loc/iloc modify the entire row even if you only want to modify a single column from the row?
df.loc[row, col] = val is a setter for the entire row, values indexed by {col:val}
How can I patch a single column's value for a single row in-place?
Thomas Havlik
@thavlik
assert df.isna().sum()['Timestamp'] == 0
df.at[i, 'Label'] = True
assert df.isna().sum()['Timestamp'] == 0 # AssertionError
Why is this happening? df.at[i, 'Label'] = True should not be purging values for other columns
Joshua Wilson
@jwilson8767
@thavlik Can you check the dtype of column Label before and after using df.at?
Joshua Wilson
@jwilson8767
Also, are you sure you don't mean to be using df.iat instead of df.at?
Thomas Havlik
@thavlik
it's bool
iAt based indexing can only have integer indexers for df.iat[i, 'Label'] = True
df.iat[i, df.columns.get_loc('Label')] = True appears to work
Joshua Wilson
@jwilson8767
Awesome, glad that was all it was.
slot-29
@slot-29
hi I'm having a problem with pandas data frame ..
it takes away the last decimal rounding
Crybik
@Crybik
hey yo
MomIsBestFriend
@MomIsBestFriend
Hello, I would really like to contribute, but I feel so lost in this huge project.
Anyone can recommend me a simple yet productive issue? i'd love to handle it
Gabriel Corona
@randomstuff
@jreback: Shall I rebase instead of merge ? (pandas-dev/pandas#28459)
OK, no it's documented on the contributing doc.
andymcarter
@andymcarter
@Dr-Irv thanks, I have multiple dataframes of different shapes on a single excel tab, so keeping track of the exact position and extent of each df reprecluded using xlsxwriter. I did end up figuring out an implementation for the 3 colormap styler without xlsxwriter, modifying this SO post (https://stackoverflow.com/a/57445863/8731272)
dvir1
@dvir1

Hi,
I'm trying to create a python environment as described here https://dev.pandas.io/docs/development/contributing.html#creating-a-development-environment but the command "python -m pip install -e . --no-build-isolation" fails due to unknown version of pandas (pandas 0+unknown), how to fix it?

Output:

Obtaining file:///C:/Users/GuestUser/Documents/GitHub/pandas
Preparing wheel metadata ... done
Requirement already satisfied: pytz>=2017.2 in c:\users\guestuser\miniconda3\envs\pandas-dev\lib\site-packages (from pandas==0+unknown) (2019.2)
Requirement already satisfied: numpy>=1.13.3 in c:\users\guestuser\miniconda3\envs\pandas-dev\lib\site-packages (from pandas==0+unknown) (1.16.5)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\guestuser\miniconda3\envs\pandas-dev\lib\site-packages (from pandas==0+unknown) (2.8.0)
Requirement already satisfied: six>=1.5 in c:\users\guestuser\miniconda3\envs\pandas-dev\lib\site-packages (from python-dateutil>=2.6.1->pandas==0+unknown) (1.12.0)
ERROR: xarray 0.13.0 has requirement pandas>=0.19.2, but you'll have pandas 0+unknown which is incompatible.
ERROR: statsmodels 0.10.1 has requirement pandas>=0.19, but you'll have pandas 0+unknown which is incompatible.
ERROR: seaborn 0.9.0 has requirement pandas>=0.15.2, but you'll have pandas 0+unknown which is incompatible.
ERROR: fastparquet 0.3.2 has requirement pandas>=0.19, but you'll have pandas 0+unknown which is incompatible.
Installing collected packages: pandas
Found existing installation: pandas 0+unknown
Can't uninstall 'pandas'. No files were found to uninstall.
Running setup.py develop for pandas

Successfully installed pandas-0.25.1

Thanks

Tom Augspurger
@TomAugspurger

It looks like it may have succeeded?

But if you’re worried, you might repeatedly conda uninstall -y --force pandas and pip uninstall -y pandas and maybe remove any pandas directories under your site-packages folder, including a possible pandas.dist_info or pandas.egg_info.