Ityala lemiqolo ephindwe kabini

Ukuzama ukucima iirekhodi eziphindwe kabini kwi-Excel usebenzisa isoftware yasimahla

Umthengi weza kum enengxaki. Ndinesiseko sedatha kwi-spreadsheet ye-Excel eneerekhodi ezingaphezu kwesigidi, ezimbalwa zazo ziphindaphinda. Apha kulapho iinzame zam zokusombulula ityala lemiqolo ephindwe kabini zaqala khona.

Kuba ndingathandi ukuchitha ixesha labafundi, Ndiyanixelela ukuba umcimbi uphelile ukusonjululwa ngeyona ndlela ilula, kusetyenziswa umsebenzi we-Excel 365 esebenza ngokuchanekileyo ukuphelisa impinda yemigca. Nangona kunjalo, njenge-linuxer elungileyo ndizamile iindlela ezinzima ngakumbi kuqala. Nantso into eli nqaku malunga nayo

Ityala lemiqolo ephindwe kabini

Kufuneka kuthiwe, nangona i-LibreOffice Calc ingenayo ingxaki yokuvula ifayile yememori ye-136 MB kwaye inokujongwa ngokupheleleyo kwaye isetyenzwe ngayo, bekungenakwenzeka ukugcina, kuzo zombini iifomati zomthonyama kunye neMicrosoft. Ndinekhomputha ene-8 GB yememori kunye ne-AMD A6-9500 iprosesa, kodwa kufuneka uzame ukuyigcina okanye isicelo siya kuvala okanye ikhompyutha iya kuphazamiseka.

Ngokubanzi, ndithanda ukusebenzisa usetyenziso lwentsusa apho uxwebhu lwenziwe, olugcina iintloko ezininzi (ubukhulu becala impazamo yezicelo zeMicrosoft ezingaqheleki ukwamkela ukuphazamiseka) kodwa Windows 10 isahlulelo endihlala ndisisebenzisa kwezi. iimeko ziye zala ukusebenza, ngoko ke phambi kokuba ndifake kwakhona ndaye ndagqiba ekubeni ndizame ezinye izinto.

iibhere neenyoka

En elinye inqaku Sele ndikuxelele amanyathelo okufaka iinkqubo ezivela kumphathi wepakethe yePip kwiinguqulelo ezintsha ze-Ubuntu Kuba ulwazi malunga nokudala ii-macros kwi-LibreOffice Calc lunqabile kwaye luphelelwe lixesha, ndigqibe kwelokuba ndisebenzise iskripthi sePython.

Enyanisweni, siyakopela. Iskripthi se-python sithatha idatha kwi-spreadsheet ye-Excel, kwaye siyingenisa ngaphandle usebenzisa ilayibrari yokuhlalutya idatha. umnxeba Iipanda. Nje ukuba eli thala leencwadi liqhube idatha, i-spreadsheet entsha ye-Excel yenziwe.

Ndagqiba ekubeni ndizame into elula, ndiyicela ukuba indixelele inani lemiqolo enedatha ephindwe kabini. Inkqubo imi ngolu hlobo lulandelayo (Khumbula ukujonga kuqala kwinqaku endikubonise lona)

pip3 install pandas openpyxl Lo myalelo ufaka iilayibrari ezisivumela ukuba sisebenze ngedatha kwaye sisebenzisane ne-Excel templates.

Emva koko ndavula umhleli wombhalo kwaye ndabhala ikhowudi elandelayo.

# Importa la biblioteca Pandas
import pandas as pd

def fumanisa_imigca_ephindiweyo(indlela):
# Layisha ifayile ye-Excel kwi-pandas DataFrame
df = pd.read_excel(indlela)

# Fumana imiqolo ephindwe kabini
impinda = df.iphindiwe ()

# Bonisa amanani emigca emiqolo ephindwe kabini
imigca_ephindiweyo = iphindiwe[eziphindiweyo].index.tolist()
ukuba impinda_imigca:
print("Le migca ilandelayo yerewu ephindwe kabini ifunyenwe:")
yomgca kwi-duplicate_layini:
shicilela(umgca)
enye:
print("Akukho migca iphindiweyo ifunyenwe kwi-spreadsheet.")

# Indlela yefayile ye-Excel
excel_file = "file.xlsx"

# Fowunela umsebenzi ukuze ufumane imiqolo ephindwe kabini
Khangela_imigca_ephindiweyo(ifayile_egqwesileyo)

Ndiyigcine njenge-excel1.py kwaye ndayiqhuba nayo python3 excel1.py
Ngenxa yokuba isiphumo sibonise ukuba mininzi imiqolo ephindwe kabini ndaye ndagqiba ekubeni ndenze iskripthi esiza kuzicima kwaye sisuse umqolo ongenanto. Ikhowudi yile:
import pandas as pd

# Layisha i-Excel spreadsheet
excel_file = 'file.xlsx'
df = pd.read_excel(excel_file, injini='openpyxl')

# Cima idatha ephindwe kabini ushiya kuphela umqolo wokuqala kunye nedatha
df_no_duplicates = df.drop_duplicates(gcina='okokuqala')

# Bhala isiphumo sokudityaniswa kwefayile entsha ye-Excel
df_without_duplicates.to_excel('file2.xlsx', index=Bubuxoki, injini='openpyxl')

Ndiyigcine phantsi kwegama le-excel2.py kwaye ndayiqhuba ngomyalelo python3 excel2.py

Andazi ukuba kutheni ingasebenzi kuba iphetha ngokuvala i-terminal emva kwemizuzu embalwa kwaye ifayile entsha ayizange idalwe.nokuba. Ngapha koko, ndiye ndagqiba ukufaka kwakhona iiWindows kunye neOfisi kwaye ndisebenzisa umyalelo olula ozisa iofisi yeMicrosoft eyakhelweyo, engqina ukuba i-razor ka-Ockham iyasebenza nakwisoftware. Nangona kunjalo, inkqubo yokuqala endiyibhalileyo yandinceda ukuba ndenze ukukhangela ngokukhawuleza ukuba yonke idatha ephindwe kabini isusiwe. Nangona kunjalo, ndiceba ukuqhubeka nokuphanda kunye nokuxela iziphumo.

Ngendlela, mhlawumbi kungenxa yokungabikho kwamaxwebhu, kodwa umkhwa wabantu abasebenzisa i-spreadsheets xa kukho abaphathi bedatha banomdla.


Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Inoxanduva lwedatha: I-AB Internet Networks 2008 SL
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.

  1.   JF404 sitsho

    Ngaba uye wazama ukulungisa iimpazamo kwiskripthi ukuze ufumanise apho besilela khona?
    Nangona xa kufikwa kubathengi, eyona nto ifanelekileyo kukuhambisa iziphumo ngokukhawuleza, ngenxa yokufun’ ukwazi okumsulwa ungalungisa impazamo kwiskripthi kwaye uzame ukuchonga impazamo, ngaloo ndlela uzigcinele ixesha kwaye wenze iskripthi esinokusetyenziswa kuwe. ngelixa elizayo.

    1.    UDiego waseJamani uGonzalez sitsho

      Hayi, khange ithi qatha kum.
      Ndiyibeke kuluhlu lwezinto eziza kwenziwa.
      Kuyavela kum ukuba yingxaki yememori, ifayile inkulu kakhulu.

      1.    juan sitsho

        Zama ukusebenzisa i-XlsxWriter endaweni ye-openpyxl

        1.    UDiego waseJamani uGonzalez sitsho

          Qaphela. Enkosi.

  2.   ingelosi sitsho

    Ndingacebisa ukuba wenze umlinganiselo wokusetyenziswa kwenkunzi yegusha yeskripthi. Ukulayisha idataframes kwimemori kwenza kube lula ukuba imisebenzi enzulu iphelelwe yimithombo. Unokuba nomdla ekubekeni iliso kwiipolar

    1.    UDiego waseJamani uGonzalez sitsho

      Enkosi. Qaphela.

  3.   Louis sitsho

    Ukuba ifayile egqwesileyo iqulethe kuphela idatha, akukho fomula, iimacros, imizobo, njl. njl., ukhetho olulungileyo kukuthumela ngaphandle njenge CSV kwaye uyiqhube ngohlobo, ngolu hlobo:

    1- Vula ikhonsoli (cmd.exe)
    2- Bhala: hlela / ifayile eyodwa.csv > output.csv
    3- Yivule kwakhona kwi-excel kwaye uyigcine njengefomathi ye-XLSX

    Xa usebenzisa i-linux:

    1- Vula isikhululo,
    2- Bhala: hlela -u file.csv > output.csv

    1.    UDiego waseJamani uGonzalez sitsho

      Uluvo olulungile. Ndizakuzama

  4.   UGregory ros sitsho

    Izimvo zokugqibela ndizenza ngokwam. Andazi ukuba kutheni ii-database zenziwa ukuba azisebenzisi kamva kwaye zibone ukuba i-spreadsheet ilula ukuyisebenzisa, ngakumbi isiseko sedatha.