'How to import python package like nltk in jython?
I am trying to import nltk
in Jython and calling that from java file but it is showing "no module found" error.
Test.java:
PythonInterpreter interp = new PythonInterpreter();
System.out.println("Hello, world from Java");
interp.execfile("main.py");
main.py:
import sys;
import os;
import nltk;
from nltk import word_tokenize
Solution 1:[1]
When reset_index() is used, it adds the old index as a column in the dataframe. You can set drop = True to drop the old indexes:
reset_index(drop = True)
Solution 2:[2]
This sounds like a simpler solution to me.
df1['Ti'] = 'am'
df2['Ti'] = 'pm'
new_def = df1.append(df2)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | rob0tst0p |
Solution 2 | Ball Hog |