ezdxf

How to clean CSV file for a coordinate system using pandas?

青春壹個敷衍的年華 提交于 2020-11-25 04:12:00
问题 I wanted to create a program to convert CSV files to DXF(AutoCAD), but the CSV file sometimes comes with a header and sometimes no and there are cells that cannot be empty such as coordinates, and I also noticed that after excluding some of the inputs the value is nan or NaN and it was necessary to get rid of them so I offer you my answer and please share your opinions to implement a better method. sample input output 回答1: solution import string import pandas def pandas_clean_csv(csv_file): "

How to clean CSV file for a coordinate system using pandas?

孤者浪人 提交于 2020-11-25 04:09:39
问题 I wanted to create a program to convert CSV files to DXF(AutoCAD), but the CSV file sometimes comes with a header and sometimes no and there are cells that cannot be empty such as coordinates, and I also noticed that after excluding some of the inputs the value is nan or NaN and it was necessary to get rid of them so I offer you my answer and please share your opinions to implement a better method. sample input output 回答1: solution import string import pandas def pandas_clean_csv(csv_file): "

Python and ezdxf copying blocks

末鹿安然 提交于 2020-04-07 09:05:55
问题 I have a dxf file with one or more blocks. How can I use ezdxf to read this dxf and copy a block to another dxf file? This code does not work as expected: dxf = ezdxf.readfile("blocks.dxf") block_test = dxf.blocks.get('b_test') dxf_test = ezdxf.readfile("arc.dxf") msp_test = dxf_test.modelspace() flag = dxf_test.blocks.new(name='FLAG') flag.add_lwpolyline([(0, 0), (0, 5), (4, 3), (0, 3)]) flag.add_circle((0, 0), .4, dxfattribs={'color': 2}) msp_test.add_blockref(block_test, (10.1, 10.1),