TypeError: DataFrame.drop() takes from 1 to 2 positional arguments but 3 were given
wy6688 opened this issue · 2 comments
26 # Quick fix for red bar width bug. We calculate the
42File c:\tools\miniconda3\envs\ml4t310\lib\site-packages\pyLDAvis_prepare.py:432, in prepare(topic_term_dists, doc_topic_dists, doc_lengths, vocab, term_frequency, R, lambda_step, mds, n_jobs, plot_opts, sort_topics, start_index)
47 # term frequencies internally, using the topic term distributions and the
428 # topic frequencies, rather than using the user-supplied term frequencies.
429 # For a detailed discussion, see: cpsievert/LDAvis#41
430 term_frequency = np.sum(term_topic_freq, axis=0)
--> 432 topic_info = _topic_info(topic_term_dists, topic_proportion,
433 term_frequency, term_topic_freq, vocab, lambda_step, R,
434 n_jobs, start_index)
435 token_table = _token_table(topic_info, term_topic_freq, vocab, term_frequency, start_index)
436 topic_coordinates = _topic_coordinates(mds, topic_term_dists, topic_proportion, start_index)
File c:\tools\miniconda3\envs\ml4t310\lib\site-packages\pyLDAvis_prepare.py:244, in _topic_info(topic_term_dists, topic_proportion, term_frequency, term_topic_freq, vocab, lambda_step, R, n_jobs, start_index)
236 # Order the terms for the "default" view by decreasing saliency:
237 default_term_info = pd.DataFrame({
238 'saliency': saliency,
239 'Term': vocab,
240 'Freq': term_frequency,
241 'Total': term_frequency,
242 'Category': 'Default'})
243 default_term_info = default_term_info.sort_values(
--> 244 by='saliency', ascending=False).head(R).drop('saliency', 1)
245 # Rounding Freq and Total to integer values to match LDAvis code:
246 default_term_info['Freq'] = np.floor(default_term_info['Freq'])
TypeError: DataFrame.drop() takes from 1 to 2 positional arguments but 3 were given
=====================================================
In the new Pandas 2.x release, the drop shall use .drop(saliency, axis=1), can someone fix this issues in next release?
thanks