welfare-state-analytics / welfare_state_analytics

Welfare State Analytics
5 stars 0 forks source link

Error i notebook #105

Closed Stubbendorff closed 4 years ago

Stubbendorff commented 4 years ago

Fredrik har haft samma problem, när vi filtrerat på adjektiv:

ValueError                                Traceback (most recent call last)
c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\penelope\notebook\concept_co_occurrences_gui.py in on_button_clicked(_)
    205                 count_threshold = None if gui.count_threshold.value < 2 else gui.count_threshold.value
    206 
--> 207                 concept_co_occurrence_workflow(
    208                     input_filename=gui.input_filename_chooser.selected,
    209                     output_filename=output_filename,

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\penelope\workflows\_concept_co_occurrence.py in execute_workflow(input_filename, output_filename, concept_opts, annotation_opts, tokens_transform_opts, count_threshold, partition_keys, filename_field, store_vectorized)
    101 
    102     if store_vectorized:
--> 103         v_corpus = to_vectorized_corpus(co_occurrences=coo_df, value_column='value_n_t')
    104         v_corpus.dump(tag=strip_path_and_extension(output_filename), folder=os.path.split(output_filename)[0])
    105 

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\penelope\co_occurrence\concept_co_occurrence.py in to_vectorized_corpus(co_occurrences, value_column)
    232     year2index = {year: i for i, year in enumerate(years)}
    233 
--> 234     df_yearly_weights = pd.DataFrame(
    235         data={
    236             'year_index': co_occurrences.year.apply(lambda y: year2index[y]),

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\pandas\core\frame.py in __init__(self, data, index, columns, dtype, copy)
    466 
    467         elif isinstance(data, dict):
--> 468             mgr = init_dict(data, index, columns, dtype=dtype)
    469         elif isinstance(data, ma.MaskedArray):
    470             import numpy.ma.mrecords as mrecords

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\pandas\core\internals\construction.py in init_dict(data, index, columns, dtype)
    281             arr if not is_datetime64tz_dtype(arr) else arr.copy() for arr in arrays
    282         ]
--> 283     return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)
    284 
    285 

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\pandas\core\internals\construction.py in arrays_to_mgr(arrays, arr_names, index, columns, dtype, verify_integrity)
     91     axes = [columns, index]
     92 
---> 93     return create_block_manager_from_arrays(arrays, arr_names, axes)
     94 
     95 

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\pandas\core\internals\managers.py in create_block_manager_from_arrays(arrays, names, axes)
   1686         return mgr
   1687     except ValueError as e:
-> 1688         raise construction_error(len(arrays), arrays[0].shape, axes, e)
   1689 
   1690 

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\pandas\core\internals\managers.py in create_block_manager_from_arrays(arrays, names, axes)
   1682     try:
   1683         blocks = form_blocks(arrays, names, axes)
-> 1684         mgr = BlockManager(blocks, axes)
   1685         mgr._consolidate_inplace()
   1686         return mgr

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\pandas\core\internals\managers.py in __init__(self, blocks, axes, do_integrity_check)
    147 
    148         if do_integrity_check:
--> 149             self._verify_integrity()
    150 
    151         # Populate known_consolidate, blknos, and blklocs lazily

c:\users\joja0140\appdata\local\pypoetry\cache\virtualenvs\humlab-westac-deploy-65n0so9r-py3.8\lib\site-packages\pandas\core\internals\managers.py in _verify_integrity(self)
    324         for block in self.blocks:
    325             if block.shape[1:] != mgr_shape[1:]:
--> 326                 raise construction_error(tot_items, block.shape[1:], self.axes)
    327         if len(self.items) != tot_items:
    328             raise AssertionError(

ValueError: Shape of passed values is (6, 3), indices imply (0, 3)
roger-mahler commented 4 years ago

Tack för felrapporten!

Lägg gärna in JSON-fil med optioner om den finns, alternativt ett skärmurklipp av parametrar i gränsytan - eller ange dem i felloggen. Sista raden antyder att det är väldigt få dokument som matchar parametersätttningen, vilket resulterar i tom samförekomstmatris. I nuvarande implementation måste fokusordets PoS-tag ingå i urvalet PoS-taggar. Annars filtreras fokusorden bort.

roger-mahler commented 4 years ago

Tips: Markera felloggen efter att du klistrat in det i ärendet och tryck på "<>" i kommentarens verktygsfält. Då blir loggen mer lättläst.