Giter Site home page Giter Site logo

rafalkucharskipk / visum_to_pandas Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 6.0 28.42 MB

python scripts to parse visum .net and .dmd file to pandas and store as .csv files

License: MIT License

Python 100.00%
pandas-dataframe pandas ptv transportation-simulation transportation-network

visum_to_pandas's Introduction

visum_to_pandas's People

Contributors

patrikhlobil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

visum_to_pandas's Issues

Improvement of parse function

Hi Rafal,

I have to say that your visum_to_pandas script is great. I worked a bit on the most recent version and made the following changes/improvement for the "parse" function:

  • use os.path.join for the combination of paths
  • use "string".split(9 to get rid of newline and space characters
  • auto-detect COL_SEPARATOR
  • do not export index of DataFrame
  • add parameters (export_path, export) to the parse function:

:param export_path (optional): Path to folder, where to save the CSV files.
If not specified, the CSV files are save in
folder of the net files.
:param export (optional): List of network objects that should be exported. If
not specified, all network objects will be exported.

If you like, you can just include my changes in your code. The file was uploaded with the name "ptv_visum_to_pandas_2.py".

Best regards,

Patrik

Usability and capsulation

Hi Rafal,

what do you think about the following ideas?

  1. If the script is called as main, we could show the user a prompt (using wxpython or tkinter) where he can select via a file dialogue, where the .net, .dmd or matrix files lie. This would be very user friendly. On the other hand, if imported as a module one can still use the functions as they are.
  2. For me, it seems as if the visum_to_pandas.py file contains quite a lot of testing code. I think we should separate that purely to the test.py file. This encapsulation simplifies the reusability of the module in my opinion.
  3. I also have a script that automatically reads in an attribute file to a DataFrame. It also contains functions to remove units and convert to datetime objects. It is attached
    VisumPy_add.zip
    One could also consider adding such functions to your package.

Best,

Patrik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.