Delete ColumnΒΆ
Example
>>> import shutil
>>> shutil.copy("examples/fintech/database.csv.zip", "examples/fintech/data/processed/database.csv.zip")
'examples/fintech/data/processed/database.csv.zip'
>>> # Creates, configures, and runs the operator
>>> from techminer2.database.operators import CopyColumn
>>> (
... CopyColumn()
... #
... # FIELDS:
... .with_field("author_keywords")
... .with_other_field("author_keywords_copy")
... #
... # DATABASE:
... .where_root_directory("examples/fintech/")
... #
... .run()
... )
>>> # Deletes the field
>>> from techminer2.database.operators import DeleteColumn
>>> (
... DeleteOperator()
... .with_field("author_keywords_copy")
... .where_root_directory("examples/fintech/")
... .run()
... )
>>> # Query the database to test the operator
>>> from techminer2.io import Query
>>> df = (
... Query()
... .with_query_expression("SELECT * FROM database LIMIT 5;")
... .where_root_directory("examples/fintech/")
... .where_database("main")
... .where_record_years_range(None, None)
... .where_record_citations_range(None, None)
... .run()
... )
>>> print("author_keywords_copy" in df.columns)
False