Closed nleroy917 closed 1 year ago
After investigating peppy: it's not a problem with Project.from_pandas()
function, it's how pandas is working.
The problem that you mentioned: duplicated sample_name
value it's not actually duplication. One sample_name
is name of the index (row names) and second is actual value.
To solve this issue just add parameter index=False
--> p.sample_table.to_csv(index=False)
Issue
When instantiating a
peppy.Project()
object using thefrom_pandas
method, a duplicatesample_name
column is created in the resultantpandas.DataFrame
object.Expected Behavior
I would expect only one
sample_name
column to be present when the table is instantiated.Steps to reproduce
Create fresh virtual
env
:Create the sample table file:
Load
peppy
/pandas
and create newProject()
object usingfrom_pandas
:df = pd.read_csv("sample_table.csv") p = peppy.Project().from_pandas(df) p.sample_table.to_csv("sample_table_processed.csv")