update. /JL

This commit is contained in:
2024-02-14 18:21:33 +01:00
parent be82c84f9d
commit e879e30678
4 changed files with 28361 additions and 0 deletions

15
my_pandas.py Normal file
View File

@@ -0,0 +1,15 @@
import pandas as pd
import io
print("Pandas version: ", pd.__version__)
def xml2df(xml_file):
with open(xml_file, "r") as F:
xml_data = F.read()
return pd.read_xml(io.StringIO(xml_data), parser="etree", xpath=".//component-class//feature-value")
if __name__ == "__main__":
df = xml2df("test_data.tcx")
df.assign(counter = lambda df: df.groupby('.//component/name').cumcount())
print(df)