Using the following code:
predictions = pd.DataFrame([x6,x5,x4,x3,x2,x1])
print(predictions)
Prints the following in the console:
0
0 782.367392
1 783.314159
2 726.904744
3 772.089101
4 728.797342
5 753.678877
How do I print predictions
without row (0-5) or column (0) indexes?
In R the code would look like:
print(predictions, row.names = FALSE)
Using DataFrame. to_string() to Print DataFrame without Index. You can use DataFrame. to_string(index=False) on the DataFrame object to print.
You can delete a list of rows from Pandas by passing the list of indices to the drop() method. In this code, [5,6] is the index of the rows you want to delete. axis=0 denotes that rows should be deleted from the dataframe.
print(df.to_string(index=False, header=False))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With