mito icon indicating copy to clipboard operation
mito copied to clipboard

Dates in column headers errors

Open aarondr77 opened this issue 2 years ago • 1 comments

Describe the bug Mito does a bad job of handling dates in column headers.

To Reproduce Run this code in a Jupter notebook

import pandas as pd
import numpy as np
import mitosheet
zz = np.random.rand(10000,10000)

def create_header():
    names = []
    for i in range(10000):
        names.append(f'Path_{i}')
    
    return names

col_head = create_header()

infer_datetime_format=True
z = pd.date_range(start='18/12/1994', end='05/04/2022') 

df =pd.DataFrame(zz, columns = col_head)
df.insert(loc=0, column='Date', value = z)
df.set_index('Date', inplace= True)
df1 = df.T
df1.head(5)

mitosheet.sheet(df1, view_df=True)
Screen Shot 2022-04-05 at 10 29 43 AM

aarondr77 avatar Apr 05 '22 14:04 aarondr77

Ok, the update is I spent an hour on this and I was not able to create a statisfactory solution. The main issue is that the only two solution I can think of that seems straight forward seem to result in a performance impact that we don't want to go for.

If you want to see it, check out the branch date-header-fix. Check out the two different commits - they each try two solutions. Even on running the tests alone, they are noticeable (about 30%) slower. Maybe this was just a fluke, so try yourself.

Let me know thoughts - feel free to take a shot.

naterush avatar Apr 18 '22 21:04 naterush