Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two dataframes merged
#7
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('2',len(f))
    #print(f.head(4))
    if f is not None:
        f = f[f['dtime']<r['atime']]
    print('3',len(f))
    #print(f.head(4))
    if f is not None:
        ind = iloc(f)
    print('4',f.head(4))
    if ind>=0:
        print(ind)
        cleaned[ind]['atime','arrival','cost']=r['atime','arrival','cost']
    break
Still testing - this almost worked but errors as it cannot find the index of the cleaned to update the values...
Reply


Messages In This Thread
Two dataframes merged - by Ecniv - Jun-04-2019, 06:46 PM
RE: Two dataframes merged - by chisox721 - Jun-05-2019, 06:51 PM
RE: Two dataframes merged - by Ecniv - Jun-06-2019, 06:41 PM
RE: Two dataframes merged - by chisox721 - Jun-06-2019, 07:02 PM
RE: Two dataframes merged - by Ecniv - Jun-06-2019, 08:52 PM
RE: Two dataframes merged - by chisox721 - Jun-15-2019, 08:58 PM
RE: Two dataframes merged - by Ecniv - Jun-11-2019, 07:14 PM
RE: Two dataframes merged - by Ecniv - Jun-11-2019, 08:25 PM
RE: Two dataframes merged - by Ecniv - Jun-12-2019, 08:12 PM
RE: Two dataframes merged - by Ecniv - Jun-13-2019, 06:25 PM
RE: Two dataframes merged - by Ecniv - Jun-16-2019, 09:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Merging two DataFrames based on indexes from two other DataFrames lucinda_rigeitti 0 1,759 Jan-16-2020, 08:36 PM
Last Post: lucinda_rigeitti
  Read exel with merged cells and write to another excel SriMekala 0 2,992 Aug-10-2019, 07:14 AM
Last Post: SriMekala
  how read and write merged cells in excel SriMekala 1 15,155 Aug-07-2019, 11:27 PM
Last Post: scidam

Forum Jump:

User Panel Messages

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