728x90
반응형
from pandas import DataFrame
import pandas as pd
df = DataFrame({'cost': [250, 150, 100],'revenue': [100, 250, 300]},index=['A', 'B', 'C'])
print(df)
print(df.eq(100))
import pdb; pdb.set_trace()
score = df.eq(100).mean(axis=1) * 100
# axis=1 means row-wise
# axis=0 means column-wise
How to calculate matching percentage difference between two dataframe
I am looking to find the percentage difference between two dataframes. I have tried using fuzzywuzzy but not getting the expected output for the same. Suppose i have 2 dataframes with 3 columns eac...
stackoverflow.com
728x90
반응형
'사소한 Tip . 오류 해결법' 카테고리의 다른 글
728x90
반응형
from pandas import DataFrame
import pandas as pd
df = DataFrame({'cost': [250, 150, 100],'revenue': [100, 250, 300]},index=['A', 'B', 'C'])
print(df)
print(df.eq(100))
import pdb; pdb.set_trace()
score = df.eq(100).mean(axis=1) * 100
# axis=1 means row-wise
# axis=0 means column-wise
How to calculate matching percentage difference between two dataframe
I am looking to find the percentage difference between two dataframes. I have tried using fuzzywuzzy but not getting the expected output for the same. Suppose i have 2 dataframes with 3 columns eac...
stackoverflow.com
728x90
반응형