Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Pandas Dataframe to Google Big Query
Post: RE: Pandas Dataframe to Google Big Query

Thank you.
Ecniv Data Science 2 3,044 Nov-21-2019, 02:26 PM
    Thread: how to apply user defined function to Pandas DataFrame
Post: RE: how to apply user defined function to Pandas D...

perhaps try something like : df['cashflow'] = df.apply( cash_flow_list(df['fv'],df['cp_rate'],df['maturity_year'],df['coupon_per_year'])** But I am new to python and pandas - usually doesnt do what I ...
Ecniv Data Science 3 7,648 Aug-20-2019, 03:52 PM
    Thread: Pandas Dataframe to Google Big Query
Post: Pandas Dataframe to Google Big Query

Hiya, Just when I almost get it, it slips away. I have a dataframe that I would like to put into a google big query table. However (aha) as per normal, when I try it, it just errors (pyarrow cannot ...
Ecniv Data Science 2 3,044 Aug-20-2019, 09:12 AM
    Thread: Pivot dataframe
Post: RE: Pivot dataframe

Probably need the original sheet of data too ? Reading the doc perhaps its more : import pandas as pd import numpy as np input=r'D:\\pivotdata.xlsx' sheet_name='Sheet1' # csv new (create) file df=pd....
Ecniv Data Science 2 2,313 Jun-21-2019, 02:19 PM
    Thread: Pandas - updating the original dataframe with sub selects
Post: Pandas - updating the original dataframe with sub ...

Hi I have a dataframe with the follwoing columns source date host tag adreq adimpr revenue Device deletemeNow some of the rows have things I do not want to see, but I do not want to delete. How do I ...
Ecniv Data Science 0 2,026 Jun-21-2019, 02:12 PM
    Thread: Imported csv, column text converted to number but not summing
Post: RE: Imported csv, column text converted to number ...

Hi thanks Nice suggestion, I did indeed end up using it. As it was in a process which received different files it had to change for that one file. Works fine :) Thank you
Ecniv Data Science 4 2,902 Jun-21-2019, 02:03 PM
    Thread: [pandas] How to re-arrange DataFrame columns
Post: RE: [pandas] How to re-arrange DataFrame columns

Sorry I am new, but as a question/suggestion, can you use group by ? something like: df.groupby(by=['Name','Trial1Sub_item1','Trial1Sub_item2','Trial1Sub_item3','Trial2Sub_item4','Trial2Sub_item5'])**...
Ecniv Data Science 8 4,951 Jun-21-2019, 08:22 AM
    Thread: Imported csv, column text converted to number but not summing
Post: RE: Imported csv, column text converted to number ...

nope. It has business data in it. import pandas as pd df = pd.DataFrame([['a','1,00'],['b','1.000,20'],['c','123,45']],columns=['source','rev']) r=['rev'] for c in r: df.update(df[c].str.replac...
Ecniv Data Science 4 2,902 Jun-21-2019, 07:59 AM
    Thread: Imported csv, column text converted to number but not summing
Post: Imported csv, column text converted to number but ...

Hi Obviously did this wrong. Situation: CSV text file importing into pandas Problem, the source has numbers with ., rather than ,. so its been imported as text. Applied a replace (for . to nothing) ...
Ecniv Data Science 4 2,902 Jun-20-2019, 03:52 PM
    Thread: Aligning data
Post: RE: Aligning data

Whats your python code atm? I'm still a really novice... but I tried the following. May be it will help or offer a different way import pandas as pd sample_data = [ ('sample001a.com', -12, 's...
Ecniv Data Science 8 3,811 Jun-20-2019, 03:23 PM
    Thread: Aligning data
Post: RE: Aligning data (sorry) :(

If the rows arent connected, you should be able to import it as duel columns. Group by should work on it then... although you may need to split the sample into other columns to get sample number an le...
Ecniv Data Science 8 3,811 Jun-18-2019, 07:07 PM
    Thread: Aligning data
Post: RE: Aligning data (sorry) :(

maybe try the dataframes .groupby option ?
Ecniv Data Science 8 3,811 Jun-17-2019, 06:25 PM
    Thread: Two dataframes merged
Post: RE: Two dataframes merged

Quote:Date Check-in Departure Check-out \ 0 04-05-2019 09:53 Ouderkerk a/d Amstel, Ouderkerk a/d Amst NaN 1 04-05-2019 NaN Ouderkerk a/d Amstel, O...
Ecniv Data Science 10 5,271 Jun-16-2019, 09:10 PM
    Thread: Simple String to Time within a pandas dataframe
Post: Simple String to Time within a pandas dataframe

Hi I have a data frame with strings that look like date and another column of time. What would be the best way to convert them to actual datetime objects (or to two objects of date and time) ? Note ...
Ecniv Data Science 1 2,519 Jun-13-2019, 09:12 PM
    Thread: Two dataframes merged
Post: RE: Two dataframes merged

for i,r in checkout.iterrows(): ind = -1 f = cleaned[cleaned['atime'].isnull()] if f is not None: f = f[f['date']==r['date']] if f is not None: f = f[f['dtime']<r['a...
Ecniv Data Science 10 5,271 Jun-13-2019, 06:25 PM
    Thread: Two dataframes merged
Post: RE: Two dataframes merged

Ok. Managed to get the index back and find the original row via the index. However it is still not doing it (still erroring) so I must still be doing it wrong.... any ideas (I have a headache now) Fin...
Ecniv Data Science 10 5,271 Jun-12-2019, 08:12 PM
    Thread: Two dataframes merged
Post: RE: Two dataframes merged

for i,r in checkout.iterrows(): ind = -1 f = cleaned[cleaned['atime'].isnull()] print('1',len(f)) #print(f.head(4)) if f is not None: f = f[f['date']==r['date']] print(...
Ecniv Data Science 10 5,271 Jun-11-2019, 08:25 PM
    Thread: Statistical analysis of two dataframes
Post: RE: Statistical analysis of two dataframes

Wouldnt you do just make a new df with an if statement comparison... Compare dataframes Equals or different
Ecniv Data Science 1 2,580 Jun-11-2019, 07:26 PM
    Thread: Two dataframes merged
Post: RE: Two dataframes merged

Weirdly if I use one or the other to filter the dataframe, it runs. But both together and it errors.
Ecniv Data Science 10 5,271 Jun-11-2019, 07:14 PM
    Thread: Two dataframes merged
Post: RE: Two dataframes merged

Ahh almost got it... but not quite... import os import re import datetime as dt import numpy import pandas as pd data = None try: df = pd.read_csv('privatefiles/t.csv',';') #df = pd.read_csv(...
Ecniv Data Science 10 5,271 Jun-06-2019, 08:52 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020