For my app I’m using Pandas read_csv() method for reading a csv file and I skip the first rows like this:
df_flocs = pd.read_csv(f, sep=";", index_col=False, skipinitialspace=True, skiprows=2)
This works fine as developer, although I have to skip one row more than expected to read the correct column headers. When I publish the app the app my the app doesn’t work and I have to skip one row less than in the developer environment.
Do you know why there is a difference in this method before and after publishing?
Interesting issue. Did you specify the python version your app uses in your config.toml file?
(see the docs for more on this)
This is my toml file. I’m not sure if the problem was there when I was running 3.7.
# Various app settings can be defined in the viktor.config.toml file.
# For more information, see: https://docs.viktor.ai/docs/create-apps/fundamentals/#viktorconfigtoml
app_type = 'simple' # 'simple' | 'tree'
python_version = "3.9"
For now it’s not a big issue as I adjust my csv files before uploading, however I have to keep two version all the time.
Did you already do some research on this topic? Let me know!
Sorry for the delay, I can’t seem to replicate your issue.
Am I correct in assuming that your csv is structured as such that the third row contains the column headers and the subsequent rows contain the data (and no index column is included)?