xxxxxxxxxx
pip install dataframe_image
import dataframe_image as dfi
df = pd.DataFrame(np.random.randn(6, 6), columns=list('ABCDEF'))
# style your table if you want by:
df_styled = df.style.background_gradient() #adding a gradient based on values in cell
dfi.export(df_styled,"mytable.png")
xxxxxxxxxx
import pandas as pd
# Create a sample dataframe
df = pd.DataFrame({'Column1': [1, 2, 3],
'Column2': ['A', 'B', 'C']})
# Save dataframe to a CSV file
df.to_csv('data.csv', index=False)
# Alternatively, save to other formats like Excel, JSON, etc.
df.to_excel('data.xlsx', index=False)
df.to_json('data.json', orient='records')
xxxxxxxxxx
# save and load of DataFrames with pickle
dateiTraining = "daten/Training.zip"
trainDataFrame.to_pickle( self.dateiTraining )
if ( os.path.exists( dateiTraining ) ):
testDataFrame = panda.read_pickle( dateiTraining )